This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes batchUpdate problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "batchUpdate problem" Watch "batchUpdate problem" New topic

batchUpdate problem

shilpa vijay

Joined: Mar 29, 2009
Posts: 4
I want to update 100 records in a table ,I am using batchUpdate but it is giving following error
Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.StatementImpl.executeBatch(
at Task.Sample.updateUrl(
at Task.Sample.fetchHundredRecordFromURLS(
at Task.Sample.fetchHundredRecordFromURLS(
at Task.Sample.main(

how to overcome this.
I am using mysql
Rahul P Kumar
Ranch Hand

Joined: Sep 26, 2009
Posts: 188
try this link
shilpa vijay

Joined: Mar 29, 2009
Posts: 4
I solved the problem.
As I was trying to update 100 records at a is updating successfully
close connection wherver required,make sure that while updating records there shd be only one active connection .
If if more than active conjection ,then this type of error will occur.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: batchUpdate problem
jQuery in Action, 3rd edition