• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JTA transaction or resource-local transaction.

 
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assume the entity manager below:



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

Please help.
 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for Raf and Ralph
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ralph is right, I used wrong names for the element and attribute.
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic