• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic