commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30391] New: - dbcp connection object hangs
Date Thu, 29 Jul 2004 16:12:22 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30391>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30391

dbcp connection object hangs

           Summary: dbcp connection object hangs
           Product: Commons
           Version: 1.1 Final
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: dilish.k@sonata-software.com


When the network connection between tomcat 4.1.29 and database (experienced with
sybase ASE 12.5) is lost, the 'Connection' hangs indefinitely. 

It hangs in the line of code "con = DatasourceObject.getConnection();"

None of the other options in the connection pooling stuff - add info: used
SharedPoolDatasourceFactory in dbcp - like maxWait / validationQuery
/removeAbandoned/ removeAbandonedTimeout etc doesnt timeout the connection.

Analysis: When the network connection to the database is fine (normal scenario)-
the dbcp gets a connection from the datasource (connection pool)- sets three
params - autocommit, readonly and isolation level for the connection object and
returns this improved connection object to the calling class.  

Now say the network connection is lost, and the unaware application requests for
a connection from the pool, gets the connection object and then tries to set the
first of three params (autocommit- mentioned above) where it hangs.

None of the timeout params work in this scenario. Setting a validationQuery
tries its validation only after getting the connection object which never happens. 

Soln(possibility): after getting the raw connection object - run a validation
query (or any call to database)with a stmt.setQueryTimeout() set to say 3-5 secs
- or say configurable by user - and then catch the exception (noroutetohost
exception) to throw it back.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message