New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction #268
Comments
Can you share your quartz.properties and is there any special DB configuration you used? |
Sorry for late response @zemian because the problem appear again private Properties getQuartzProperties() { I'm using mysql 5.7 with standard configuration and it problem appear again do you have any solution |
Hi @ariawanzero This means your DB is not able to acquire the proper lock using the QRTZ_LOCKS table. Also tell us the workload of your quartz scheduler (how many jobs do you have running, how long does each job run on avg etc.) when this problem occur. |
I also noticed you have a custom jobStore class |
…maphore for Failure obtaining db row lock
It seems like this failure error will occur only when the load is too heavy and the DB is not able to acquire the DB lock within the time allowed to handle the work. I have added a PR #363 as improvement that allow you to configure the maxRetry and retryTimeout (in millis) parameters to avoid this error message. To use it, you need to get latest code and add the following to quartz configuration:
|
Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction #268
Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction #268
I'm using quartz on my java project with version 2.2.3 and getting This Error
org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction
| at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:157)
| at org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:113)
| at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3796)
| at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggersFired(JobStoreSupport.java:2916)
| at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:336)
| Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
| at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
| at com.mysql.jdbc.Util.getInstance(Util.java:408)
| at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
| at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
| at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
| at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
| at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
| at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2487)
| at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
| at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966)
| at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
| at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
| at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:96)
| ... 4 common frames omitted
Anyone have solution for this?
The text was updated successfully, but these errors were encountered: