• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Application-Managed EntityManager transaction type must be RESOURCE_LOCAL

 
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

[P-312 of Ejb3 In Action Book"] states:
"For application-based EntityManager, the transaction-type must be set to RESOURCE_LOCAL in the persistence.xml file".
but in case the application is running inside container (App server) , it can join JTA transaction. Sp why always transaction-type should be
RESOURCE_LOCAL.?
 
author
Posts: 304
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Either you misunderstood what it said, or it is incorrect.

You should not have to explicitly set the transaction type to RESOURCE_LOCAL when using JPA in non-managed mode (outside a container).
That is the default. In fact, you are better off not setting the transaction type so that if you move to running in a container then
you will automatically be transitioned to use the container default transaction type of JTA without having to change the setting.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic