It's not a secret anymore!
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Resource Local Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "Resource Local Transactions" Watch "Resource Local Transactions" New topic
Author

Resource Local Transactions

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 383
Are resource local transaction propogated?


SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

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.


SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
Vinay Nath
Ranch Hand

Joined: Jul 06, 2008
Posts: 85
Only JTA transactions are propagated.


SCDJWS 5.0, SCBCD 5.0, SCWCD 5.0, SCJP 5.0
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Resource Local Transactions
 
Similar Threads
ejb-local-ref and ejb-ref
JTA and Resource Local Entity Manager
Doubt in JTA & resource-local entity managers
resource manager local transaction
Using joinTransaction() on resource-local entity managers.