This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Resource Local Transactions  RSS feed

 
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are resource local transaction propogated?
 
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean "resource-local entity manager transactions"?

I don't think so.

As per the specs:

ejb-persistence, section 5.5


A container-managed entity manager must be a JTA entity manager. JTA entity managers are only specified for use in Java EE containers.
An application-managed entity manager may be either a JTA entity manager or a resource-local entity manager.



ejb-persistence, section 5.6


When a container-managed entity manager is used, the lifecycle of the persistence context is always managed automatically, transparently to the application, and the persistence context is propagated with the JTA transaction.



ejb-persistence, section 5.6.3


As described in section 5.1, a single persistence context may correspond to one or more JTA entity manager instances (all associated with the same entity manager factory).
The persistence context is propagated across the entity manager instances as the JTA transaction is propagated.
Propagation of persistence contexts only applies within a local environment. Persistence contexts are not propagated to remote tiers.



Finally, and more important (ejb-persistence, section 5.7):


[...] The extended persistence context obtained from the application-managed entity manager is a stand-alone persistence context�it is not propagated with the transaction.

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only JTA transactions are propagated.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!