• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An illegal attempt to commit a one phase capable resource with existing two phase ca

 
Bala RThiagarajan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one explain what wil happen if i use both Xa connection and a normal connetion in a single EJB transaction.

Cause in the application i am getting the following error and i doubt its because both Xa connection and a normal connetion has been used in a single EJB transaction
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bala,
Welcome to JavaRanch!

If there is a transaction rollback, it will likely not work properly. While you can sometimes rollback one non-XA event in a transaction, it doesn't always work properly.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you need XA? As the XA protocol is a significant overhead compared to local transactions, you should consider carefully if distributed transactions are really needed.
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Bala,

J2EE 1.4 onwards JTA was implicitly supported by all compliant app servers. If you have only one resource either nonXA or XA participating in a transaction then it automatically starts a one phase commit(local transaction). It more than one nonXA resource participates in a local transaction... then the transaction is rolled back. If more than one XA resources participate in transaction then the transaction becomes a global transaction(2 phase commit).

Ideally for a 2 phase commit(global transaction) all resources must be XA or else the transaction is rolled back. However most of the servers support something called as "last agent optimization" which allows one and only one nonXA resource to participate in a global transaction (2 phase commit). So if you have set this flag to true on your appserver's transaction service then you should not get any rollbacks due to XA and nonXA resource participating in a global transaction
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic