Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

resouce-local and JPA transactions

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone explain to me what is the difference between a resource_local transaction and a JPA transaction?

Thanks in advance
 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about EJB2.0 or EJB3.0?
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

With JPA you can speciy two types of transactions :

1- RESSOUCE_LOCAL : available in and outside a JEE environment, and rely on the underline Data Source you use. For example you can use this type to work with database transaction.

2- JTA : for Java Transaction API it's only available in a JEE environment. This kind of transaction is more rich than the first one. You can have a transaction with different Data Source for different types. For example between a database and LDAP.

When you are in a JEE environment, the JTA is the default value. However, RESSOUCE_LOCAL is the defaut value in a SE environment.

I hope this help.
 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
Short and help explanation.
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to add, you would have to use EntityTransaction API with RESOURCE_LOCAL transactions and the related entity manager would be a resource local entity manager.
 
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!