users@glassfish.java.net

Re: JCA Connection Association problem (Glassfish v3)

From: <glassfish_at_javadesktop.org>
Date: Sat, 20 Feb 2010 22:15:09 PST

This behavior is due to connection sharing.

You can refer :
1) Connector Specification 1.6 (JSR 322) :
     Section : 7.9 Connection Sharing
2) http://blogs.sun.com/JagadishPrasath/entry/connectionsharinginglassfish

a)
The implementation under discussion uses same connection factory to talk to 2 external systems which can be an issue if the resource-adapter's transaction support that will be offered by this connection-factory (and hence the connection pool) is "LocalTransaction".

For LocalTransaction capable resources (connections), connection sharing will always be done as multiple resources cannot be used in a LocalTransaction.

b)
If the implementation under discussion has XATransaction capability, then you can specify
<res-sharing-scope>Unshareable</res-sharing-scope> in the "resource-ref" of ejb-jar/web.xml

c)
If the implementation does not need to take part in transaction, you can create a non-transactional connection pool (--transactionsupport attribute).

For (b) and (c) sharing will not happen.
[Message sent by forum member 'jr158900' (Jagadish.Ramu_at_Sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=387816