You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/07/22 00:13:15 UTC

DO NOT REPLY [Bug 35825] New: - NullPoinTerException retrieving connection from the pool

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=35825>.
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=35825

           Summary: NullPoinTerException retrieving connection from the pool
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: fedor.karpelevitch@mscibarra.com


under some load we start getting this exception when retrieving connection from
pool:

org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection info
from pool
        at
org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectionAndInfo(SharedPoolDataSource.java:169)
        at
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:631)
        at
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:615)
        at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:705)
        ... 34 more
Caused by: java.lang.NullPointerException
        at
org.apache.commons.collections.SequencedHashMap.insertEntry(SequencedHashMap.java:226)
        at
org.apache.commons.collections.SequencedHashMap.put(SequencedHashMap.java:451)
        at org.apache.commons.collections.LRUMap.put(LRUMap.java:125)
        at
org.apache.commons.dbcp.datasources.SharedPoolDataSource.getUserPassKey(SharedPoolDataSource.java:179)
        at
org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectionAndInfo(SharedPoolDataSource.java:165)
        ... 37 more

this is apparently caused by improper syncronization:

SharedPoolDataSource.getPooledConnectionAndInfo() is synchronized _instance_
method, but it accesses SharedPoolDataSource.userKeys which is a _static_
variable, so if you have more than one instance of SharedPoolDataSource (as we
do) access to the map would not be properly synchronized. So either map should
be made instance variable, or the method should be synchronized on the class,
not instance.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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