Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

UserTransaction vs EntityTransaction and distributed transactions

 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Could anyone tell me the answers to there questions:
1. I can have a bean with CMT, but persistence that is "resource-local", meaning that it is not created by the container, but using Persistence.createEntityManagerFactory(). When the bean method is invoked, what is the relationship between the UserTransaction used behind the scenes by the container, and the EntityTransaction (which I think I must use, because if I don't, the provider - TopLink in my case - moans it needs a transaction)? Is the user transaction suspended, or are these two transactions completely unrelated?

2. I created my custom DataSource to be able to connect to Oracle, chose persistence to be of type "JTA", and specified this in the <jta-data-source> element of persistence.xml. It all works fine, the container crates and injects the EntityManager for me. However, the actual type of my data source was OracleXADataSource. So I gather it can be part of a distributed transaction - UserTransaction. What if it was not XADataSource? How would the container behave? Could it participate in UserTransaction?

Thanks.
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!