You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2001/10/12 23:48:17 UTC

DO NOT REPLY [Bug 4132] New: - possible problem with GenericDataSource.close

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4132>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4132

possible problem with GenericDataSource.close

           Summary: possible problem with GenericDataSource.close
           Product: Struts
           Version: Nightly Build
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Controller
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: mdecorte@yahoo.com


I'm seeing some unexpected behavior in 
org.apache.struts.util.GenericDataSource.close.

- use struts DataSource pooling
- get a Connection via DataSource 
- fail to close it
- when you try to reload or close the ActionServlet via 
http://localhost/manager:8080/reload?...., 
org.apache.struts.util.GenericDataSource.close goes into an infinite loop.

The reason is that org.apache.struts.util.GenericDataSource.activeCount and 
org.apache.struts.util.GenericDataSource.connections.length() get out of sync.  
So in 

close calls getConnection and each decrements and increments activeCount to no 
avail.

Solution:

- tell developers (like me) to fix their code :-)

- change close to not use activeCount, perhaps using connections.isEmpty()

- change GenericDataSource so it tracks connections both in and out of pool, 
and close both sets of links