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]

Reply via email to