You should always be releasing the connection back to the connection pool.
This means you should have a finally statement on your try/catch so that it
is always released. Then you shouldn't have this problem when an exception
occurs. In terms of the connection pool I'm using, you also have a maximum
number you allocate as well as a minimum, so it will automatically get a new
connection for you - up to the max. At some point, however, you will run out
unless you free the connection, so be careful to always do that, even when
an exception occurs.
Gary
> -----Original Message-----
> From: Aurelio [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, May 17, 1999 10:59 AM
> To: [EMAIL PROTECTED]
> Subject: CONNECTION POOL AGAIN
>
> Hello,
> My connection pool works fine, but I have found a problem. When I am
> using a servlet, the servlet requests a connection in each service and
> returns it to the pool when its task has finished. The problem arises
> when it has been an SQLException. Then, when the connection object is
> returned to the pool, it keeps memory of this error, so if I only have
> one connection in the pool, the following time the servlet is called,
> takes the same connection, and when trying to do the sql command, the
> exception is there. How exactly does connection object work? Does it
> "remember" the error state for a statement? And, if so, how can I know
> it when asking for a connection to the pool (in order to create a new
> one)?
>
> Thanks
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html