My Mistake, Sorry.

----- Original Message -----
From: "Geir Magnusson Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 15, 2001 1:15 PM
Subject: Re: Connection Pool Bug


> Leon,
>
> Did you inadvertantly send this to the Velocity list rather than the
> Turbine list?
>
> :)
>
> geir
>
>
> Leon Messerschmidt wrote:
> >
> > Hi,
> >
> > I get an sql (connection closed) exception when using a new Turbine CVS.
It
> > does this with both MySQL/Linux and Interbase/Win2K.  I think I've found
a
> > problem with the dbConnecion.
> >
> > For some reason my connection becomes invalid (I'd like to know why this
> > happens in the first place :-).  When the DBPool Tries to close the
invalid
> > connection it throws an exception because the connection is already
closed.
> > The problem is that the close() method call the getConnection() method,
> > which throws an exception on a closed connection. Here is a proposed
Patch:
> >
> > RCS file:
> >
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/util/db/pool/DBConnect
> > ion.java,v
> > retrieving revision 1.17
> > diff -r1.17 DBConnection.java
> > 507d506
> > <         Connection conn = getConnection();
> > 510c509
> > <             if ( conn != null && !conn.isClosed() )
> > ---
> > >             if ( connection != null && !connection.isClosed() )
> > 512c511
> > <                 conn.close();
> > ---
> > >                 connection.close();
> >
> > ~ Leon
> >
> > Horrible Exception: java.sql.SQLException: Connection is closed!
> >         at
> >
org.apache.turbine.util.db.pool.DBConnection.getConnection(DBConnection.java
> > , Compiled Code)
> >         at
> > org.apache.turbine.util.db.pool.DBConnection.close(DBConnection.java,
> > Compiled Code)
> >         at
> >
org.apache.turbine.util.db.pool.ConnectionPool.popConnection(ConnectionPool.
> > java, Compiled Code)
> >         at
> >
org.apache.turbine.util.db.pool.ConnectionPool.getInternalPooledConnection(C
> > onnectionPool.java, Compiled Code)
> >         at
> >
org.apache.turbine.util.db.pool.ConnectionPool.getConnection(ConnectionPool.
> > java, Compiled Code)
> >         at
> >
org.apache.turbine.services.db.TurbinePoolBrokerService.getConnection(Turbin
> > ePoolBrokerService.java, Compiled Code)
> >         at
> > org.apache.turbine.services.db.TurbineDB.getConnection(TurbineDB.java,
> > Compiled Code)
> >         at
org.apache.turbine.om.peer.BasePeer.executeQuery(BasePeer.java,
> > Compiled Code)
> >         at org.apache.turbine.om.peer.BasePeer.doSelect(BasePeer.java,
> > Compiled Code)
> >         at
> >
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer
> > .java, Compiled Code)
> >         at
> >
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer
> > .java, Compiled Code)
> >         at
> >
org.apache.turbine.services.security.DBUserManager.retrieve(DBUserManager.ja
> > va, Comppilde Code)
>
> --
> Geir Magnusson Jr.                               [EMAIL PROTECTED]
> Developing for the web?  See http://jakarta.apache.org/velocity/

Reply via email to