Can you confirm that should be the case with the latest version of JBoss AS 5.0.0.Beta3/4?
If you see the JCA specs you would notice this
The container returns a connection handle using the same ManagedConnection
instance that was used for handling the connection request from A.
So for the scenario described in 7.10.3 the connection handles are shared and not the physical connections(ManagedConnection)
I see this happening from the code also .
The above explaination would answer why you have 2 inUseConnectionCount.
I am not sure if I did answer your question here , Did I answer it ?
I can resolve this issue by setting the property:
in jbossjta-properties.xml but I don't think that is the solution. When running this test with AS 4.2, calling EJB2's business method to get another connection shows that we are tracking by Tx; i.e.,
getManagedConnection trackByTx=true tx=TransactionImple < ac, BasicAction: -53efacde:e2c1:476000d6:51 status: ActionStatus.RUNNING >
and we get the connectionfrom the pool trackedByTx:
Got connection from pool tracked by transaction org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1d63c55
Using connection from pool tracked by transaction org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1d63c55
With the old xslt deployer, these mbean attributes were set :
With AS5, calling ds2.getConnection() in EJB2, trackByTx is false;
getManagedConnection trackByTx=false tx=null subject=null
supplying new ManagedConnection: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@17dbcd4
Got connection from pool org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@17dbcd4
With the new deployment
TRACE [org.jboss.resource.deployment.ResourceAdapterObjectModelFactory:486] transaction support setValue: nuri=http://java.sun.com/xml/ns/j2ee localName=transaction-support value=LocalTransaction
was added for the ConnectorMetaData but I don't see TrackStatements.