• Post Reply Bookmark Topic Watch Topic
  • New Topic

Locking a Oracle table using JDBC  RSS feed

 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!