Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Toplink locking

 
Sahil Sharma
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there a default locking if we don't use locking explicitly in Toplink? If yes, is it pessimistic or optimistic.

Thanks
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default is not locking in TopLink and JPA. You should configure either optimistic locking or pessimistic locking.
Normally optimistic locking is recommended for web applications, but it depends on your locking requirements.

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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic