1
votes

I am trying to understand local and global transaction in JPA. In JPA Specs I found that there are two type of transaction that is RESOURCE_LOCAL and JTA aka GlobalTransaction. But what I read somewhere that to participate in global transaction Datasource should be XA-complient. When we declare <jta-datasource> in persistence.xml . It is javax.sql.DataSource type ,It is not javax.sql.XADataSource type and It still takes part in Global Transaction .It always confuses me. Please provide me a clear understanding.

Thanks

1

1 Answers

1
votes

I was able to understand reading JTA Spec after and after and It says:

When there are multiple transcational resources e.g. Datasources,JMS queues etc, taking part in JTA they all must be XA-Complient . When there is single resource, condition does not necessarily hold true means It may or may not XA-Complient;