Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Application-Managed EntityManager transaction type must be RESOURCE_LOCAL  RSS feed

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • 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.?
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!