Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Locking and Version
icon5.gif  Locking and Version [message #759243] Mon, 28 November 2011 02:37 Go to next message
pop prem is currently offline pop premFriend
Messages: 20
Registered: June 2010
Junior Member
Hi,

I need to clarify some of my doubts related to eclipselink locking.

How can i configure eclipselink that a row level lock should be held rather than a table level? I'm using spring transactions and havn't touched any configurations related to locking in eclipselink, so it uses default locking (optimistic). Please correct me if i'm wrong here.

I have added @Version column in my entity classes to support locking mechanism. Is this a good way or do i have to use the Locking API in code too like entityManager.lock or @Lock etc? Should i use these locks in code even when i have configured database transactions through spring? I'm confused with the usage of code level locking and declarative transaction management.

Thanks.
Re: Locking and Version [message #759369 is a reply to message #759243] Mon, 28 November 2011 13:48 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Row versus table locks are up to your database, and can only be configured on your database. You can execute a native SQL query if you really want to lock an entire table, although not normally a good idea.

See,
http://en.wikibooks.org/wiki/Java_Persistence/Locking


James : Wiki : Book : Blog : Twitter
Previous Topic:EclipseLink Maven repository missing
Next Topic:Locking and Version
Goto Forum:
  


Current Time: Tue Apr 23 14:55:41 GMT 2024

Powered by FUDForum. Page generated in 0.03484 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top