[jboss-user] [Datasource Configuration] - Re: How more than one XA Datasources participate in one container managed transaction ?

Wolf-Dieter Fink do-not-reply at jboss.com
Thu Dec 13 11:03:50 EST 2012


Wolf-Dieter Fink [https://community.jboss.org/people/wdfink] created the discussion

"Re: How more than one XA Datasources participate in one container managed transaction ?"

To view the discussion, visit: https://community.jboss.org/message/783314#783314

--------------------------------------------------------------
If you use CMT the container will track which resource is involved in the transaction.
If the EJB is finished (mean that the business method return) the container will send a prepare to all XA resources and if successful a commit.
It is the responsibility of the container how to do this. AFAIK JBoss will send prepare/commit in that order the resources are got from the container( but this might change with different versions).

Also if you use different resources from an EJB, or a couple of EJB's, inside the same JBoss instance you do not need a JTS configuration. It will be more complex and might have performance drawbacks as it uses IIOP.

So a Tx is committed if you return from a method with a different Tx scope, let me shown an example:

Method1 (Tx.Required)
   do DB stuff
  -> M2 (Tx.NotSupported)
      Tx1 suspended
   -> M3 (Tx.Required)
        Tx2
       do DB stuff maybe different DB'S
       return
   <-  (prepare)commit Tx2
   <-
<-
 (prepare)commit Tx1

The commits are done by the container outside your code (also outside the interceptors)
There is no configuration to control that.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/783314#783314]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121213/0c3ee2c3/attachment.html 


More information about the jboss-user mailing list