This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For update and Lock

 
vicky Aggarwal
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have to perform some action in a table which shall be synchronized with multiple instances.

I created two tables first Lock and second which contains actual data. Now each instance first tries to acquire lock on Lock table by using
Select X from Lock for update.

My application is running fine, but I have a threat that if application which have lock goes down due to any error.

Will my application work or will it stuck?
If yes how to solve it and if not then how lock will be release and how such locks work?

Thanks in Advance.


 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Schedule a background process that constantly checks the Lock table for those that have been held for more than a hour and release them. I believe, this should solve your issue.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic