aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes JTA transaction or resource-local transaction. 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 "JTA transaction or resource-local transaction." Watch "JTA transaction or resource-local transaction." New topic
Author

JTA transaction or resource-local transaction.

Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Assume the entity manager below:



Is this EntityManager in JTA transaction or resource-local transaction?

Please help.
Raf Szczypiorski
Ranch Hand

Joined: Aug 21, 2008
Posts: 383
Hi. It depends on how your persistence.xml is configured - the attribute type of element persistence-context determines this. If it is omitted, it defaults to JTA in EE, and to RESOURCE_LOCAL in SE.
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
It is an application managed entity manager. The transaction type depends on the settings in the persistence.xml file:

<persistence-unit name="PU">
<persistence-unit name="PU" transaction-type="JTA">

declare an JTA transaction entity manager (tansaction-type="JTA" is default), while

<persistence-unit name="PU" transaction-type="RESOURCE_LOCAL">

declares a resource-local transaction entity manager.


SCJP 5 (98%) - SCBCD 5 (98%)
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Thanks for Raf and Ralph
Raf Szczypiorski
Ranch Hand

Joined: Aug 21, 2008
Posts: 383
Ralph is right, I used wrong names for the element and attribute.
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
By the way (with fresh expressions from exam): It's good to have a clear understanding of the various types of entity managers (application managed vs. container managed, JTA vs. resource local transactions) and their persistence contexts (transaction scoped vs. extended).
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
Ralph Jaus wrote:By the way (with fresh expressions from exam): It's good to have a clear understanding of the various types of entity managers (application managed vs. container managed, JTA vs. resource local transactions) and their persistence contexts (transaction scoped vs. extended).


I agree with this completely! For understanding this, I recommend PRO EJB3 Book, Chapter 5. MUST READ!


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTA transaction or resource-local transaction.