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

setting lock timeout

 
JP Estrada
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys... im using MS SQL 2000. Is there a way in java to set the lock timeout?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JP,
Which locks? The database locks?
 
JP Estrada
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes database locks... i read somewhere that you can set through the connection string. something like:

jdbc:microsoft:sqlserver://111.22.4.12:1234;DatabaseName=testlab;selectMethod=cursor;lockTimeout=100


But is there a way in java to trap a database lock? If the lock times out will it throw an exception?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by JP Estrada:
But is there a way in java to trap a database lock?

I don't know of a way to do that. This doesn't mean it is impossible of course, just not common.


If the lock times out will it throw an exception?

Yes. You will get a SQLException for any type of database problem.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic