I think you must call close on CallableStatement (AFAIK, I've search source code and 
there is no restriction). But, the best way to discover, is just test...

Edson

  ----- Original Message ----- 
  From: Graham Lounder 
  To: 'OJB Users List' ; 'Armin Waibel' 
  Sent: Monday, September 15, 2003 4:23 PM
  Subject: RE: Connection Manager Question


  Ok, so I should still call the close on the CallableStatement?  My DBA was
  telling me I was getting open cursors left on the DB so I added the
  cs.close(); and conn.close().  I'm  guessing if I just remove the
  conn.close() and let the broker.close() handle it.

  Thanks,
  Graham

  -----Original Message-----
  From: Armin Waibel [mailto:[EMAIL PROTECTED]
  Sent: Monday, September 15, 2003 4:14 PM
  To: OJB Users List
  Subject: Re: Connection Manager Question


  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]


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



  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.518 / Virus Database: 316 - Release Date: 11/9/2003

Reply via email to