Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Table Getting Locked While Updating a Single Row

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,

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.

Thanks
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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
 
Sheriff
Posts: 28360
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I was going to move it to JDBC but then I noticed there was already a duplicate copy of this post there already. So I'll just close this one.
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
    Bookmark Topic Watch Topic
  • New Topic