ETC / / 2023. 2. 3. 17:41

[Error] Lock wait timeout exceeded; try restarting transaction

728x90
 

 


 

Contents

     

     

     

    Lock wait timeout exceeded

    인텔리제이로 디버깅 하면서 코딩하다가 갑자기 쿼츠 스케쥴러가 안 도는 현상이 발생.

     

     

    에러

    2023-02-03 16:55:15.723 ERROR [,,] 23116 --- [_MisfireHandler] o.s.s.quartz.LocalDataSourceJobStore     : MisfireHandler: Error handling misfires: Couldn't store trigger '----' for '----' job:Lock wait timeout exceeded; try restarting transaction
    
    org.quartz.JobPersistenceException: Couldn't store trigger '---' for '---' job:Lock wait timeout exceeded; try restarting transaction
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1228)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport.doUpdateOfMisfiredTrigger(JobStoreSupport.java:1042)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverMisfiredJobs(JobStoreSupport.java:991)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport.doRecoverMisfires(JobStoreSupport.java:3264)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.manage(JobStoreSupport.java:4012)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.run(JobStoreSupport.java:4033)
    Caused by: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
    	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:123)
    	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    	at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:555)
    	at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:339)
    	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
    	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1009)
    	at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1320)
    	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:994)
    	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
    	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
    	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.updateTrigger(StdJDBCDelegate.java:1222)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1223)
    	... 5 common frames omitted

     

     

    문제

    트랜잭션이 걸린 기능을 인텔리제이 디버깅으로 테스트하다가

    갑자기 인텔리제이를 중단하면서 mysql에 락이 걸렸다.

    쿼츠 스케쥴러와는 상관없는 현상.

     

     

    해결

    인터넷에 mysql 프로세스리스트 등을 확인해서 pid를 찾아서 삭제하라고 되어있는데

     

    select * from information_schema.INNODB_LOCKS;       
    select * from information_schema.INNODB_LOCK_WAITS; 

    select * from information_schema.INNODB_TRX; 

     

    내경우에 INNODB_LOCKS 테이블이 확인이 되지 않았다. 

     

    우선은 그냥 인텔리제이를 껐다 켜는 것으로 잘 실행됐다. 

     

     

    300x250
    • 네이버 블로그 공유
    • 네이버 밴드 공유
    • 페이스북 공유
    • 카카오스토리 공유