Hi,
never do con.close().
Normally this is done by OJB. When not
running in a PB-tx (or managed tx), then
it is allowed to call
ConnectionManager.releaseConnection()
if you want to close the connecion 'by hand'.
Else connection was closed on
PB.abortTransaction
PB.commitTransaction
PB.close
regards,
Armin
- Original Message -
From: Graham Lounder [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 15, 2003 7:32 PM
Subject: Connection Manager Question
If I get a connection from the connection pool, do I have to close the
connection? Or will the broker.close() statement handle this? I keep
getting validation query failures when I add the conn.close()
statement.
PersistenceBroker broker = null;
try {
broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
Connection conn =
broker.serviceConnectionManager().getConnection();
CallableStatement cs = conn.prepareCall(sql);
cs.execute();
cs.close();
conn.close();
} catch(SQLException sqle) {
log.error(SQLException: + sqle.toString(), sqle);
throw new DBException(SQLException, sqle);
} catch(Exception e) {
log.error(Exception: + e.toString());
throw new DBException(Exception, e);
} finally {
broker.close();
}
Cheers,
Graham
Graham Lounder - Java Developer
CARIS Spatial Components Division
[EMAIL PROTECTED]
Phone: (506) 458-8533
Fax:(506) 459-3849
NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME
AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY.
-
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]