On Thu, 9 Nov 2006, David Gewirtz wrote:
Basically, is it bad if I decide to open and close the same database a LOT? For example, rather than opening a database when the server boots and keeping it open for the duration, is it bad if I open it for every query and close it right away? I'd set some sort of open-semaphore so multiple threads wouldn't open it at once, but then, even though different threads would be working on the database, they'd each have their own id.
David, It's neither bad nor evil ... or good. I went through this discussion with a software engineering friend and decided that the best approach -- for me -- is to open the database when the application is invoked, then issue con.commit() after a write. That way I'm assured that the change has been committed to disk and the database is in a consistent state. YMMV, Rich -- Richard B. Shepard, Ph.D. | The Environmental Permitting Applied Ecosystem Services, Inc.(TM) | Accelerator <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863 ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

