You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eickvonder Bjoern <Ei...@inside-online.de> on 2007/12/11 14:22:10 UTC

AW: Tomcat 5.5.25 DBCP SQLException: Already closed.

Meanwhile I found out that the SQLException: "Already closed" hides another SQLException. Some debugging into JPOX (which opens the connection) showed that in my scenario DBCP 1.2.2 returns an already closed conenction while DBCP 1.2.1 returns a valid connection.
I've already asked the DBCP folks...

Bjoern Eickvonder 

> -----Ursprüngliche Nachricht-----
> Von: David Smith [mailto:dns4@cornell.edu] 
> Gesendet: Freitag, 30. November 2007 14:13
> An: Tomcat Users List
> Betreff: Re: Tomcat 5.5.25 DHCP SQLException: Already closed.
> 
> I'm guessing somewhere in your code, you're calling close() on a 
> connection and that's bringing up this exception.
> 
> It would appear org.apache.commons.dbcp.PoolableConnection is going 
> against the Sun javadocs for at least java 5 which states 
> that calling 
> close() on an already closed connection is a no-op.  Doesn't 
> look like 
> an exception should be thrown here.
> 
> Probably your best bet is to ask the DBCP folks since tomcat 
> uses there 
> code directly with only a refactoring of the package name.
> 
> --David
> 
> Eickvonder Bjoern wrote:
> 
> >Hi,
> >
> >I just discovered a minor difference in the DHCP 
> implementation used in
> >Tomcat 5.5.25 vs. 5.5.23 and I'd like to know if it is a bug or a
> >feature.
> >
> >I use conncetion pooling with minIdle>0 (but no 
> validationQuery), so a
> >few connection will remain open all day long. If the 
> database now closes
> >the connection itself (either due to timeout or server restart), this
> >was no problem in Tomcat 5.5.23. The DHCP implementation 
> kicked out the
> >already closed connection out of the pool and established a 
> new one that
> >is returned.
> >Now in Tomcat 5.5.25 the connection seems to be kicked out as well in
> >the end but an exception is propageted to the caller.
> >
> >Caused by: java.sql.SQLException: Already closed.
> >	at
> >org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(Poolable
> Connection.
> >java:84)
> >	at
> >org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnec
> tionWrapper
> >.close(PoolingDataSource.java:181)
> >	at
> >org.jpox.store.rdbms.adapter.DatabaseAdapter.getConnection(Da
> tabaseAdapt
> >er.java:928)
> >	at
> >org.jpox.store.rdbms.RDBMSNonmanagedTransaction.begin(RDBMSNo
> nmanagedTra
> >nsaction.java:324)
> >	... 57 more
> >
> >Is this a bug?
> >
> >Bjoern Eickvonder
> >
> >Kennen Sie schon die inside Schulungsma?nahme zur 
> VVG-Reform? Erfahren Sie mehr dazu unter www.vvg-konzept.de. 
> >
> >Besuchen Sie uns an unserem Stand C 8 auf der Learntec in 
> Karlsruhe vom 29.-31.01.08.
> >
> >
> >Diese Mitteilung ist vertraulich und ausschlie?lich an den 
> entsprechenden Empfanger gerichtet. Wenn Sie diese Mitteilung 
> versehentlich erhalten haben, durfen Sie diese nicht 
> kopieren, weitergeben oder in sonstiger Weise verbreiten. 
> Bitte informieren Sie in einem solchen Fall den Absender und 
> loschen Sie die Mitteilung sowie alle zugehorigen Anhange.
> >
> >
> >---------------------------------------------------------------------
> >To start a new topic, e-mail: users@tomcat.apache.org
> >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >  
> >
> 
> 

Kennen Sie schon die inside Schulungsmaßnahme zur VVG-Reform? Erfahren Sie mehr dazu unter www.vvg-konzept.de. 

Besuchen Sie uns an unserem Stand C 8 auf der Learntec in Karlsruhe vom 29.-31.01.08.


Diese Mitteilung ist vertraulich und ausschließlich an den entsprechenden Empfänger gerichtet. Wenn Sie diese Mitteilung versehentlich erhalten haben, dürfen Sie diese nicht kopieren, weitergeben oder in sonstiger Weise verbreiten. Bitte informieren Sie in einem solchen Fall den Absender und löschen Sie die Mitteilung sowie alle zugehörigen Anhänge.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: AW: Tomcat 5.5.25 DBCP SQLException: Already closed.

Posted by David Smith <dn...@cornell.edu>.
Hmmm... take a look at the release notes for dbcp and see if any of the 
fixes listed might impact your environment.

--David

Eickvonder Bjoern wrote:

>Meanwhile I found out that the SQLException: "Already closed" hides another SQLException. Some debugging into JPOX (which opens the connection) showed that in my scenario DBCP 1.2.2 returns an already closed conenction while DBCP 1.2.1 returns a valid connection.
>I've already asked the DBCP folks...
>
>Bjoern Eickvonder 
>
>  
>
>>-----Ursprüngliche Nachricht-----
>>Von: David Smith [mailto:dns4@cornell.edu] 
>>Gesendet: Freitag, 30. November 2007 14:13
>>An: Tomcat Users List
>>Betreff: Re: Tomcat 5.5.25 DHCP SQLException: Already closed.
>>
>>I'm guessing somewhere in your code, you're calling close() on a 
>>connection and that's bringing up this exception.
>>
>>It would appear org.apache.commons.dbcp.PoolableConnection is going 
>>against the Sun javadocs for at least java 5 which states 
>>that calling 
>>close() on an already closed connection is a no-op.  Doesn't 
>>look like 
>>an exception should be thrown here.
>>
>>Probably your best bet is to ask the DBCP folks since tomcat 
>>uses there 
>>code directly with only a refactoring of the package name.
>>
>>--David
>>
>>Eickvonder Bjoern wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>I just discovered a minor difference in the DHCP 
>>>      
>>>
>>implementation used in
>>    
>>
>>>Tomcat 5.5.25 vs. 5.5.23 and I'd like to know if it is a bug or a
>>>feature.
>>>
>>>I use conncetion pooling with minIdle>0 (but no 
>>>      
>>>
>>validationQuery), so a
>>    
>>
>>>few connection will remain open all day long. If the 
>>>      
>>>
>>database now closes
>>    
>>
>>>the connection itself (either due to timeout or server restart), this
>>>was no problem in Tomcat 5.5.23. The DHCP implementation 
>>>      
>>>
>>kicked out the
>>    
>>
>>>already closed connection out of the pool and established a 
>>>      
>>>
>>new one that
>>    
>>
>>>is returned.
>>>Now in Tomcat 5.5.25 the connection seems to be kicked out as well in
>>>the end but an exception is propageted to the caller.
>>>
>>>Caused by: java.sql.SQLException: Already closed.
>>>	at
>>>org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(Poolable
>>>      
>>>
>>Connection.
>>    
>>
>>>java:84)
>>>	at
>>>org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnec
>>>      
>>>
>>tionWrapper
>>    
>>
>>>.close(PoolingDataSource.java:181)
>>>	at
>>>org.jpox.store.rdbms.adapter.DatabaseAdapter.getConnection(Da
>>>      
>>>
>>tabaseAdapt
>>    
>>
>>>er.java:928)
>>>	at
>>>org.jpox.store.rdbms.RDBMSNonmanagedTransaction.begin(RDBMSNo
>>>      
>>>
>>nmanagedTra
>>    
>>
>>>nsaction.java:324)
>>>	... 57 more
>>>
>>>Is this a bug?
>>>
>>>Bjoern Eickvonder
>>>
>>>Kennen Sie schon die inside Schulungsma?nahme zur 
>>>      
>>>
>>VVG-Reform? Erfahren Sie mehr dazu unter www.vvg-konzept.de. 
>>    
>>
>>>Besuchen Sie uns an unserem Stand C 8 auf der Learntec in 
>>>      
>>>
>>Karlsruhe vom 29.-31.01.08.
>>    
>>
>>>Diese Mitteilung ist vertraulich und ausschlie?lich an den 
>>>      
>>>
>>entsprechenden Empfanger gerichtet. Wenn Sie diese Mitteilung 
>>versehentlich erhalten haben, durfen Sie diese nicht 
>>kopieren, weitergeben oder in sonstiger Weise verbreiten. 
>>Bitte informieren Sie in einem solchen Fall den Absender und 
>>loschen Sie die Mitteilung sowie alle zugehorigen Anhange.
>>    
>>
>>>---------------------------------------------------------------------
>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>> 
>>>
>>>      
>>>
>>    
>>
>
>Kennen Sie schon die inside Schulungsmaßnahme zur VVG-Reform? Erfahren Sie mehr dazu unter www.vvg-konzept.de. 
>
>Besuchen Sie uns an unserem Stand C 8 auf der Learntec in Karlsruhe vom 29.-31.01.08.
>
>
>Diese Mitteilung ist vertraulich und ausschließlich an den entsprechenden Empfänger gerichtet. Wenn Sie diese Mitteilung versehentlich erhalten haben, dürfen Sie diese nicht kopieren, weitergeben oder in sonstiger Weise verbreiten. Bitte informieren Sie in einem solchen Fall den Absender und löschen Sie die Mitteilung sowie alle zugehörigen Anhänge.
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org