David Snyder wrote:

> Servlet Description:
>
> I have a servlet that receives parameters from a html page.  The parameter
> determines the class that is to be called from the service method.  Each class
> performs certain JDBC functions and outputs the results to the browser.  A
> single database connection is created in the init method of the servlet.  That
> connection is then passed to the classes when they are called, so they can
> perform their JDBC functions.
>
> Problem Description:
>
> The above servlet and its classes work fine for a brief period of time.  After
> several requests are handled, the servlet starts to receive a DB2.Exception, no
> more handles.
>
> Has anyone else come across anything like this before?  I am beginning to think
> that passing one single connection to the classes is the culprit??  Any
> ideas....
>

There are at least two possible issues.

(1) Are you closing your result sets and statements when you are done with them?
If not, then you are not releasing resources within the database, and a "No more
handles" type error after a while should be expected.

(2) Are you doing insert/update/delete actions?  If so, you're going to run into
problems with you issue COMMIT or ROLLBACK, because this affects all activity on
the (shared) connection.  The solution here is to use a connection pool, so that
any one request is handled by a single connection.

Craig McClanahan

___________________________________________________________________________
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

Reply via email to