One of two possibilities is happening here, either ResultSet's and
Statements aren't being properly closed; or Connections aren't being
released back to the Pool. Any of these conditions will eat up resources
and bring down a system.
(*Chris*)
----- Original Message -----
From: Karl Roberts <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 15, 1999 1:22 AM
Subject: Re: JDBC-Oracle connections not disconnecting
> Hi Chris,
>
> I presume that your "ConnectionPool.release(con); " method doesn't
> actually
> close the connection?
> I feel a bit naive here but isn't the point of a connection pool to keep
> some
> connections open to reduce response time from a Database?
>
> Is what is happening to these unfortunate people that the
> statement/result set
> are keeping hold of the connection and therefore not releasing it back
> into the
> pool, which forces the pool to create new connections as it's available
> connections dwindle, which eventually leads to the database refusing
> connections?
>
> slightly confused
>
> Karl
>
> Chris Pratt wrote:
>
> > Make sure you close every ResultSet, every Statement and every
> > PreparedStatement after your done with it. It's a very good idea to do
this
> > in a finally block to make sure it always happens, something like this
works
> > well and in the newer VM's isn't too big of a performance hit:
> >
> > Connection con = ConnectionPool.get();
> > try {
> > Statement stm = con.createStatement ();
> > try {
> > ResultSet res = stm.executeQuery("select * from users where
> > username='Mark'");
> > try {
> > while(res.next()) {
> > // Do Something with the data
> > }
> > } finally {
> > res.close();
> > }
> > } finally {
> > stm.close();
> > }
> > } finally {
> > ConnectionPool.release(con);
> > }
> >
> > (*Chris*)
> >
> > ----- Original Message -----
> > From: Mark Foley <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, November 11, 1999 4:01 PM
> > Subject: JDBC-Oracle connections not disconnecting
> >
> > > Hi All!
> > >
> > > Again a problem! We are using Oracle thin JDBC drivers to talk to
Oracle
> > > 8.0.5.0 on Solaris using a dynamic connection pool. We are running
out of
> > > connections (limit = 100) even though we have no more than 2 or 3
people
> > > using the servlet at any time, and we are being careful to shrink the
pool
> > > when fewer users are 'logged in'.
> > >
> > > We have traced the connection pool and logged the connects and
disconnects
> > > to a file, and there are never more than 5 connections open at the
same
> > > time. Our DBA tells us each time Oracle runs out of connections there
are
> > > 100 connections registered to 'JDBC'. Rebooting the servlet server
> > doesn't
> > > help either.
> > >
> > > We are using IBM WebSphere 2.02 with MS IIS 4 on WinNT 4 SP5, but have
> > kept
> > > our code generic for use (if necessary) on other platforms.
> > >
> > > Any help would be most appreciated - this is a reall worry (and in the
> > land
> > > of "No Worries!" that's not good).
> > >
> > > Many thanks,
> > >
> > > Mark Foley
> > > EDS (Australia)
> > > Tel: +61-2-6275 6494
> > > e-mail1: [EMAIL PROTECTED]
> > > e-mail2: [EMAIL PROTECTED]
> > >
> > >
> >
___________________________________________________________________________
> > > 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
>
>
___________________________________________________________________________
> 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