File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Resource Local Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Resource Local Transactions" Watch "Resource Local Transactions" New topic

Resource Local Transactions

Nikhil Jain
Ranch Hand

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

SCJP 1.4, SCWCD 1.4, SCBCD 1.5, TOGAF 9, Comptia Cloud+
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:
subject: Resource Local Transactions
It's not a secret anymore!