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 2002/10/03 08:23:29 UTC

DO NOT REPLY [Bug 13235] New: - referenced UserPassKey instances get erroneously returned to the pool and subsequently reinitialized

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

referenced UserPassKey instances get erroneously returned to the pool and subsequently reinitialized

           Summary: referenced UserPassKey instances get erroneously
                    returned to the pool and subsequently reinitialized
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: roytmana@peacetech.com


I discovered this problem because my Jdbc2PoolDataSource would exaust its 
capacyty with no apparen reason. So I did some debugging and found out that An 
instance of UserPassKey which is referenced by 
GenericKeyedObjectPool._activeMap gets returned to a pool and reinitialized (so 
username/password becomes null). After that all subsequent returnObject() calls 
fail to decrement count in _activeMap 

This bug is a blocker. Jdbc2PoolDataSource can not be used while it is present.
My personal opinion is that keys should be immutable making them mutable and 
pooling them is asking for troubles. May be a user name keyed map of 
*immutable* UserPassKey instances is a safer way to avoid needless object 
creation.
Another thing. I do not understand why you need to have static map of 
datasources. I suppose you do it to make sure you do not create pool over and 
over again when jndi object factory is asked for an instance. I believe
Tomcat's environment jndi will cache data source instance after first lookup 
and will not recreate it again  but return cached instance instead.

I understand it is not a politically correct to ask for timeframe :-) but if 
you can give me an idea when do you think you can fix it I would greatly 
appreciate. If you feel it will take a while I will probably will have to write 
my own lite weight version of jdbc2 pool because I need it soon.

Pease let me know if I can help you in any way

Alex
 
Please analyze following debug output. @21726407 and other @#### are identity 
hash codes of UserPassKey instances

getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@21726407(USORG, peacetech, false)
=1} :: UserPassKey@21726407(USORG, peacetech, false
 RETURN: totalActive=0, activeMap={} :: UserPassKey@21726407(USORG, peacetech, 
false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=1} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=1} :: 
UserPassKey@21726407(USORG, peacetech, false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=2} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=2} :: 
UserPassKey@21726407(USORG, peacetech, false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=3} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=3} :: 
UserPassKey@21726407(USORG, peacetech, false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=4} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=4} :: 
UserPassKey@21726407(USORG, peacetech, false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=5} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=5} :: 
UserPassKey@21726407(USORG, peacetech, false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=6} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=6} :: 
UserPassKey@21726407(USORG, peacetech, false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=7} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=7} :: 
UserPassKey@21726407(USORG, peacetech, false)
getConnection(USORG, peacetech)
 BORROW: totalActive=1, activeMap={UserPassKey@14327460(USORG, peacetech, true)
=8} :: UserPassKey@14327460(USORG, peacetech, true)
 RETURN: totalActive=0, activeMap={UserPassKey@14327460(null, null, true)=8} :: 
UserPassKey@21726407(USORG, peacetech, false)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>