|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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) |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
रवींदर à¤à¤¾à¤•à¥à¤° (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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
रवींदर à¤à¤¾à¤•à¥à¤° (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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
रवींदर à¤à¤¾à¤•à¥à¤° (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 |
|
![]() |
| Outils de la discussion | |
|
|