• Post Reply Bookmark Topic Watch Topic
  • New Topic

Locking a Oracle table using JDBC

 
Claudia Vaz
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I have a web application, that at a certain moment has to update a table. However, someone in another session of the application may be trying to update the same row. So, a want to lock the table or the row to prevent this.
How can i do it?
Thanks in advance
Claudia Vaz
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to look at 'select .... for update' It locks the selected row(s). The lockes are released on 'commit'
Rene
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!