error : Lock wait timeout exceeded; try restarting transaction

This is a discussion on error : Lock wait timeout exceeded; try restarting transaction within the MySQL Database forums, part of the Database Forums category; hello friends, i am trying to create a java application using mysql but if i try to create multiple connections, ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-29-2008
रवींदर ठाकुर (ravinder thakur)
 
Posts: n/a
Default error : Lock wait timeout exceeded; try restarting transaction

hello friends,


i am trying to create a java application using mysql but if i try to
create multiple connections, i keep on getting this exception given
below. I have read about the TransactionDeadLockDetectionTimeOut
option but i am neither able to find config.ini nor i am running the
cluster for which this option applies.


what could be the problem here ?

thanks
ravinder thakur



java.sql.SQLException: Lock wait timeout exceeded; try restarting
transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:1056)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3308)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:18 37)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :1961)
Reply With Quote
  #2 (permalink)  
Old 03-29-2008
J.O. Aho
 
Posts: n/a
Default Re: error : Lock wait timeout exceeded; try restarting transaction

रवींदर *ाकुर (ravinder thakur) wrote:
> hello friends,
>
>
> i am trying to create a java application using mysql but if i try to
> create multiple connections, i keep on getting this exception given
> below. I have read about the TransactionDeadLockDetectionTimeOut
> option but i am neither able to find config.ini nor i am running the
> cluster for which this option applies.


Do things work with one connection?
Could be that you are having too many connections to the sql server.
It may be better to have just one connection and see to that the queries made
uses database names, so you will access the data regardless of which database
you have originally selected.


--

//Aho
Reply With Quote
  #3 (permalink)  
Old 03-29-2008
रवींदर ठाकुर (ravinder thakur)
 
Posts: n/a
Default Re: error : Lock wait timeout exceeded; try restarting transaction

thanks for the super quick response Aho.


Things do work with single connection. However as soon as i increase
it, they stop working. Apparently this is due to the small lockout
time for transaction in mysql (TransactionDeadLockDetectionTimeOut ).
but i am not able to find out any way to increase it (i cannot even
find out config.ini that people are talking about on net ) :(


thanks
ravinder
Reply With Quote
  #4 (permalink)  
Old 03-29-2008
J.O. Aho
 
Posts: n/a
Default Re: error : Lock wait timeout exceeded; try restarting transaction

रवींदर *ाकुर (ravinder thakur) wrote:

> Things do work with single connection. However as soon as i increase
> it, they stop working. Apparently this is due to the small lockout
> time for transaction in mysql (TransactionDeadLockDetectionTimeOut ).
> but i am not able to find out any way to increase it (i cannot even
> find out config.ini that people are talking about on net ) :(


As I have understood, the config.ini is used by mysql when setting up a
cluster environment and don't seem to be a default config file, so it has to
be created by the user manually.

http://dev.mysql.com/doc/refman/5.0/...nfig-file.html


I would urge you to look if you can't make your application to only use one
connection, at work we had an application that used quite many threads and a
new connection with each thread, and of course sooner or later it always run
out of connections and failed badly, requiring a restart (there was other bugs
too). I believe you will win on the long run, if you can reuse connections.

--

//Aho
Reply With Quote
  #5 (permalink)  
Old 03-29-2008
रवींदर ठाकुर (ravinder thakur)
 
Posts: n/a
Default Re: error : Lock wait timeout exceeded; try restarting transaction

got to the problem...


the problem was in the my.ini file (for windows only) that was to be
edited and not the config.ini. in this file we have to set the timeout
by setting innodb_lock_wait_timeout.
Reply With Quote
  #6 (permalink)  
Old 03-29-2008
J.O. Aho
 
Posts: n/a
Default Re: error : Lock wait timeout exceeded; try restarting transaction

रवींदर *ाकुर (ravinder thakur) wrote:
> got to the problem...
>
>
> the problem was in the my.ini file (for windows only) that was to be
> edited and not the config.ini. in this file we have to set the timeout
> by setting innodb_lock_wait_timeout.


Good to hear that you managed to solve the trouble.

--

//Aho
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:57 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0