If the connection is participating in a transaction, it will not be returned to pool till the end of transaction (commit/rollback).
There are cases where multiple connections are acquired within a transaction. In such case [connection sharing is ON] first connection will participate in the transaction (others will share the physical connection of the first connection and do the work). So, if such a non-participating connection is closed, it will be returned to pool, which is harmless. [First connection will be returned to pool only after transaction completion, even if it was closed before closing all the other connections acquired within the transaction span ]
Thanks,
-Jagadish
[Message sent by forum member 'jr158900' (jr158900)]
http://forums.java.net/jive/thread.jspa?messageID=235041