*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "resouce-local and JPA transactions" Watch "resouce-local and JPA transactions" New topic
Author

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


SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
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
Greenhorn

Joined: Mar 14, 2006
Posts: 10
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

Joined: Jul 15, 2006
Posts: 361
Thanks.
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: resouce-local and JPA transactions
 
Similar Threads
Details of Application Managed EM
Transaction
Ubuntu jpa hibernate problem
Spring + hibernate - Transaction management
Locking a table