Summary: | DataSourceRealm leaks connections | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Dominik Drzewiecki <drzewo> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | bughunt, jon.anderson |
Priority: | P1 | ||
Version: | 5.5.7 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | Windows 2000 | ||
Attachments: |
Refactored o.a.c.realm.DataSourceRealm
Modified o.a.c.realm.LocalStrings.properties o.a.c.realm.DataSourceRealm |
Description
Dominik Drzewiecki
2005-02-02 15:06:11 UTC
Didn't you mention the problem earlier in another report ? I remember something like this, but didn't see anything obvious in the code (which I'm not too familiar with). Yes, refactoring and removing the need for using two connections would be useful. Be careful not to introduce new bugs, though ;) (In reply to comment #1) > Didn't you mention the problem earlier in another report ? I remember something > like this, but didn't see anything obvious in the code (which I'm not too > familiar with). You might have confused it with this enhancement proposal: http://issues.apache.org/bugzilla/show_bug.cgi?id=33266 Both issues emerged while trying to setup a self-contained webapp (with its own datasource, realm and database driver in WEB-INF/lib). The one decribed in this report is however far more severe. Created attachment 14165 [details]
Refactored o.a.c.realm.DataSourceRealm
Created attachment 14166 [details]
Modified o.a.c.realm.LocalStrings.properties
Fixed two message keys for more consistent look (uppercesed 's' in a word
datasourceRealm). The rest of resource bundles do not contain fixed keys.
Why not ... Do you know the purpose of the if( !dbConnection.getAutoCommit() ) { dbConnection.commit(); } which was in the code before ? I do not see any writes being made. (In reply to comment #5) > Why not ... > > Do you know the purpose of the > if( !dbConnection.getAutoCommit() ) { > dbConnection.commit(); > } > which was in the code before ? I do not see any writes being made. I'll look into it (by forcing autoCommit off) and let you know if it might have any impact. Created attachment 14168 [details]
o.a.c.realm.DataSourceRealm
Indeed, according to jdbc specs, some resources (locks particularly) might not
get released when leaving the connection uncommited. I added the required block
back in a single place, just before closing the dbConnection (or should I say
returning to the pool)
I have applied your patch. *** Bug 33526 has been marked as a duplicate of this bug. *** *** Bug 33938 has been marked as a duplicate of this bug. *** |