• Post Reply Bookmark Topic Watch Topic
  • New Topic

resouce-local and JPA transactions

 
Khaled Mahmoud
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
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about EJB2.0 or EJB3.0?
 
Fadjer One
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.
 
Satya Maheshwari
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!