Actually you will only call cm.allocateConnection if you are the connection factory (or the person writing the connection factory). A client will never call this method: they will use a connection factory
cf.getConnection() or something equivalent.
All you can do is conn.close(). If you aren't using local tx, this will definitely put the connection back in the pool. If you are using local tx, it will put the connection in the pool once the tx (if any) is over.
The jboss 3 rc1/2 connection manager does a lot of work so even if you hold a connection over a method boundary it is returned to the pool if possible, and your connection handle reconnected when you get back to the same object. I can't recommend useing this however, I think explictly acquiring and closing your connection handles in the smallest possible scope is the best idea.
Will follow instructions...
I was looking for the jar containing PoolEventListener in RC2 and could not find anything. I copied jboss-pool.jar from RC1.
Is this the latest version?
rc2 includes a complete reimplementation of the jca framework. I did this because I couldn't fix the problems and limitations of the earlier implementation. Please don't bring back my nightmares!
What are you trying to do that you are looking at these internals?
Oops, spotted the mistake. I was using the example from RC1 which used PoolEvent.
The new example seems more straight forward.