Vaibhav G Garg wrote:We are having a code where we are updating the rows in a column based on a simple single where condition. Now, the code is in production but it is found that it locks the whole table sometimes. Please suggest how to prevent the table from being locked.
We are just updating a single row but yes there are multiple users of the application.
1. Is this a
Java question? Because you've come to a Java forum.
2. Without a
lot more information (not the least of which is: what db are you using?) it's impossible to answer. There are any number of strategies that you might use, just one of which is not to update until you KNOW that you need to.
3. Another might be to examine the
database's locking strategy. Maybe it's too pessimistic.
Whatever, I suspect this is probably the wrong forum; but without more info it's difficult to know exactly where it should go.
Winston