Not closing the connection is kind of the whole point of connection pooling, and OJB 
provides connection pooling.  Database connections are typically expensive to 
establish, so rather than each time you use the database creating a new connection and 
then releasing it at the end connections are maintained in a pool and just borrowed 
for a period of time and then returned so other clients can use them. It looks like 
you can specify different connection pooling implementations though so what you want 
is probably to set the following in OJB.properties:

ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl

-----Original Message-----
From: Coup, Robert Muir [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 5:08 PM
To: [EMAIL PROTECTED]
Subject: Closing ODMG JDBC Connection


Hi All,

We're using a hsqldb database for part of our application, and need to
package the database files up into a zip archive before exiting. Problem
is, OJB doesn't seem to be closing the database connection so the files
are still locked and we can't delete them once they are in the Zip file.

We use a single db reference throughout out application, initialised by
        db = OJB.getInstance().newDatabase(null);
When we go to shut it down, we call
        db.close();

Are we missing some obvious step, or do we need to start playing with
finalize()? I have tested that hsqldb releases the file locks when the
jdbc connection is closed via a call to connection.close().

Thanks for your help,
Rob :)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to