• Subject: Re: Problem with native driver
  • From: "Luther Ananda Miller" <luther.miller@xxxxxxxxxx>
  • Date: Tue, 8 Feb 2000 09:56:49 +0100
  • Organization: HYPERe

Title: RE: Problem with native driver
Since you are using the connection pool already, then perhaps the problem could be due to leaving a statement or results object open when a connection is given back to the pool.
 
The only way to be 100% sure that this does not happen is to free statements and results in a finally clause.
 
For example:
 try {
  /* prepare stmt */
  stmt = connection.prepareStatement(...);
  ...
  stmt.execute();
 
  ResultSet rs = stmt.getResultSet();
   try {
    // do something with rs
   } finally {
    if ( null != rs ) rs.close();
   }
 } finally {
  if ( null != stmt ) stmt.close();
 }
 
So even if some unexpected exception occurs, the statement is still freed.
 
Actually this is more important to do with the statement itself than the resultset, as resultsets are apparently closed automatically, but better safe than sorry:

"A result set is automatically closed by the statement that generated it when the statement is closed, executed again, or used to retrieve the next result set from a sequence of multiple result sets."

Luther

----- Original Message -----
Sent: Tuesday, 8 February 2000 9:00
Subject: RE: Problem with native driver

Yes, we will use Connections pool. This should resolve our problem,
since each client will use a different connection. The connection pool
is synchronized and we can use a limited number of connections.

I'll tell you the results

Gilles


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.