Page 1 of 1

wxSQLite3 - Some sort of connection pooling

Posted: Sun Aug 29, 2010 5:06 pm
by evstevemd
Hi,
I was thinking of some sort of database pooling with wxSQLite3.
Is it possible?

Another question, If I create wxSQLite3Database object and I want to iterate through SQLite3 database files. Should I call just Open and close or I should Open another DB and the first one will close automatically?

Thanks

Re: wxSQLite3 - Some sort of connection pooling

Posted: Mon Aug 30, 2010 7:44 pm
by utelle
evstevemd wrote:I was thinking of some sort of database pooling with wxSQLite3. Is it possible?

For database systems like Oracle where establishing a database connection is a relatively expensive operation connection pooling is certainly useful. wxSQLite3 currently doesn't have support for connection pooling and I'm not sure whether it's worth the effort to add such a feature.
evstevemd wrote:If I create wxSQLite3Database object and I want to iterate through SQLite3 database files. Should I call just Open and close or I should Open another DB and the first one will close automatically?
It's not necessary to instantiate a new wxSQLite3Database object for each database file, but currently you have to call method Close before you can reuse a wxSQLite3Database instance. Although automatically closing an associated database in case method Open is called again could be added to method Open, I don't intend to implement this feature at the moment, since it's not trivial to handle possibly still open statements. But I'll add at least a check to method Open whether a database is already associated.

Regards,

Ulrich

Posted: Mon Aug 30, 2010 8:03 pm
by evstevemd
Thanks Urlich!
I see