Bug 32029 - Exception during StandardRDBMSAdapter.close(): "already closed".
Summary: Exception during StandardRDBMSAdapter.close(): "already closed".
Status: CLOSED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: WebDAV Server (show other bugs)
Version: 2.1
Hardware: Other other
: P3 major (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-02 18:42 UTC by Gregory Block
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Patch to fix; ensures we close connection after statement when compression is enabled, and sets statement to null in close to ensure we don't use a statement that's been previously closed. (1.76 KB, patch)
2004-11-03 18:39 UTC, Gregory Block
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Block 2004-11-02 18:42:33 UTC
02 Nov 2004 19:27:07 - org.apache.slide.store.impl.rdbms.StandardRDBMSAdapter - WARNING - 
java.sql.SQLException: Already closed
java.sql.SQLException: Already closed
        at org.apache.commons.dbcp.PoolablePreparedStatement.close(PoolablePreparedStateme
nt.java:75)
        at org.apache.commons.dbcp.DelegatingStatement.close(DelegatingStatement.java:165)
        at org.apache.slide.store.impl.rdbms.StandardRDBMSAdapter.close(Unknown Source)
        at org.apache.slide.store.impl.rdbms.StandardRDBMSAdapter.retrieveRevisionContent(
Unknown Source)
        at org.apache.slide.store.impl.rdbms.AbstractRDBMSStore.retrieveRevisionContent(Un
known Source)
        at org.apache.slide.store.AbstractStore.retrieveRevisionContent(Unknown Source)
        at org.apache.slide.store.ExtendedStore.retrieveRevisionContent(Unknown Source)
        at org.apache.slide.content.ContentImpl.retrieve(Unknown Source)
        at org.apache.slide.content.ContentImpl.retrieve(Unknown Source)
        at org.apache.slide.webdav.method.GetMethod.executeRequest(Unknown Source)
        at org.apache.slide.webdav.method.AbstractWebdavMethod.run(Unknown Source)
        at org.apache.slide.webdav.WebdavServlet.service(Unknown Source)
Comment 1 Gregory Block 2004-11-03 18:39:24 UTC
Created attachment 13324 [details]
Patch to fix; ensures we close connection after statement when compression is enabled, and sets statement to null in close to ensure we don't use a statement that's been previously closed.
Comment 2 Gregory Block 2004-11-03 18:40:29 UTC
Happens if you've got compression enabled, as we close the temporary connection and then close the 
statement afterwards.  Users of DBCP pooling will probably, like me, receive the error below, when the 
prepared statement was closed in the background by the closing of the connection.

Changing the order cleans up the problem.
Comment 3 Gregory Block 2004-11-10 12:17:22 UTC
No reason for this exception not to get fixed, folks.  :)  Set compression = true on the database, where 
DBCP connection pooling is provided by JNDI name lookup configuration for that connection, and dbcp 
is configured to pool prepared statements, and you're buggered.

The patch works.  It's safe.  All you have to do is close the result set before closing the connection, and 
bob's your uncle.

Please make sure it gets into the codebase before release, so I don't have to keep building top-of-tree 
once 2.1 is released.
Comment 4 Oliver Zeigermann 2004-11-10 22:09:47 UTC
Patch applied to both release and head branch
Comment 5 Oliver Zeigermann 2004-11-10 22:12:56 UTC
Oh, and by the way, this issue certainly wasn't a major one. I beware of the 
inflationary use of severity levels. Thanks :)
Comment 6 Gregory Block 2004-11-11 16:43:53 UTC
Thanks.  :)  Without the fix, my logs drive will fill, and be full of things that aren't as interesting as I'd 
like them to be, so it's important to me.  :)

Closing.