According to the spec, chapter 126.96.36.199, multiple Connections sharing a ManagedConnection should be supported.
Yes, in the same transaction for example, the connection handles share the same
real managed connection:
UserTransaction ut = ... ut.begin(); Connection c1 = connectionFactory.getConnection(); Connection c2 = connectionFactory.getConnection();
Absent a transaction how is the pooling to know that the connection can be shared?
What you really want is a custom pool which has a pooling strategy of
"Don't Pool - Share".
The only mechanism in JBoss to use your own custom pool is to deploy using the MBeans
directly rather than using the -ds.xml (see previous posts for examples).
But the MBean api is not guaranteed to be stable across releases.