Missing check in JManagedConnection.remove()
We are getting strange warnings in jonas.start.log: 2011-01-18 14:14:23,763 : JManagedConnection.release : connection was already closed
By remote debugging, I have been able to pin down the issue, and it seems to be located in the periodic resizing of Datasources. When org.objectweb.jonas.dbm.ConnectionManager.adjust() finds an "aged" JManagedConnection, it calls destroyItem() which calls org.objectweb.jonas.dbm.JManagedConnection.remove() The problem is that remove() calls release() without checking that it actually needs releasing, therefore when the connection is idle (count=0), release logs a WARNING which is really misleading.
Am I right on this analysis and is it possible to fix it in the 4.10 branch ?
ps: I've checked the 4.10.9 and 5.x source and the code is the same