File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes resouce-local and JPA transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "resouce-local and JPA transactions" Watch "resouce-local and JPA transactions" New topic

resouce-local and JPA transactions

Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Can someone explain to me what is the difference between a resource_local transaction and a JPA transaction?

Thanks in advance

Life is the biggest school
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
Are you asking about EJB2.0 or EJB3.0?
Fadjer One

Joined: Mar 14, 2006
Posts: 10

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

Joined: Jul 15, 2006
Posts: 361
Short and help explanation.
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
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.

Thanks and Regards
I agree. Here's the link:
subject: resouce-local and JPA transactions
It's not a secret anymore!