David,

This problem occurs because each database connection has a maximum number of
cursors allowed (The default is usually 50).
Each Statement you create keeps a cursor open in the database until you
explicitly close it. So either just use the one Statement instance or
explicitly close each Statement you open.

Cheers,
Lindsay.

> -----Original Message-----
> From: David Snyder [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, 8 July 1999 5:21
> To:   [EMAIL PROTECTED]
> Subject:      No more handles
>
> After several requests of my servlet, I get a 'No more handles' error.
> CLI0129E.  SQLState=HY014.  My servlet calls five different classes
> depending on
> parameters that are passed in from html pages.
>       The classes themselves, perform simple sql statements and data
> manipulation.  The data is then formatted and sent to the browser.  The
> first
> version of the servlet created a single connection in the init section and
> passed that connection object to the class objects in the service method.
> Later
> versions of experimenting used connection pooling that passed the
> connection
> object to the class object in the service method.  Even with connection
> pooling,
> I still get a 'No more handles' error.
>      Maybe I should create statement objects in the init section and pass
> them
> to the class objects instead of the connection obejct?  Does anyone have
> any
> suggestions or ideas on this subject.  My last resort will be to create a
> new
> connection every time the service method is called.  I really don't want
> to do
> this because it is expensive.
>
> __________________________________________________________________________
> _
> 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

Reply via email to