PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > error : Lock wait timeout exceeded; try restarting transaction
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
error : Lock wait timeout exceeded; try restarting transaction

Réponse
 
LinkBack Outils de la discussion
Vieux 29/03/2008, 08h11   #1
रवींदर ठाकà¥à¤° (ravinder thakur)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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)
  Réponse avec citation
Vieux 29/03/2008, 08h38   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 29/03/2008, 08h56   #3
रवींदर ठाकà¥à¤° (ravinder thakur)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 29/03/2008, 12h39   #4
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 29/03/2008, 19h29   #5
रवींदर ठाकà¥à¤° (ravinder thakur)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
Vieux 29/03/2008, 19h42   #6
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h40.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10051 seconds with 14 queries