Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failure obtaining db row lock: No row exists in table QRTZ_LOCKS for lock named: TRIGGER_ACCESS

I'm new to Quartz scheduler and I'm using it with spring ... When I tried to run the XML file that contains Quartz configuration I got an exception stating that:

Failure obtaining db row lock: No row exists in table QRTZ_LOCKS for lock named: 
TRIGGER_ACCESS 

I found that the table QRTZ_LOCKS contains two fields: SCHED_NAME and LOCK_NAME and that I should run the following statements in my database:

INSERT INTO QRTZ_LOCKS values('my sched_name', 'TRIGGER_ACCESS'); 
INSERT INTO QRTZ_LOCKS values('my sched_name','JOB_ACCESS'); 
INSERT INTO QRTZ_LOCKS values('my sched_name','CALENDAR_ACCESS'); 
INSERT INTO QRTZ_LOCKS values('my sched_name','STATE_ACCESS'); 
INSERT INTO QRTZ_LOCKS values('my sched_name','MISFIRE_ACCESS');  

but I don't have a clue what is my sched_name ??

Any idea ??

like image 309
user1802327 Avatar asked Nov 12 '12 07:11

user1802327


3 Answers

You just need to run

      INSERT INTO QRTZ_LOCKS values('TRIGGER_ACCESS');
      INSERT INTO QRTZ_LOCKS values('JOB_ACCESS');
      INSERT INTO QRTZ_LOCKS values('CALENDAR_ACCESS');
      INSERT INTO QRTZ_LOCKS values('STATE_ACCESS');
      INSERT INTO QRTZ_LOCKS values('MISFIRE_ACCESS');

That worked for me actually. Stopped the error at least.

like image 128
Ransom Avatar answered Sep 19 '22 12:09

Ransom


That is most likely because you got the table scripts from a newer version of Quartz then you are applying on your application.

If you are using Spring, then you must have Quartz 1.8.x.

This is where you can find version 1.8.6

Note: Inside that tar.gz file there is another file without extension. It is a zip file which contains a folder named doc. In there you can find a script for several database engines.

No manual modifications on data should be necessary.

like image 35
Lisandro Avatar answered Sep 21 '22 12:09

Lisandro


*my_sched_name* can be retrieved from the table qrtz_job_details (sched_name). You must have an issue with your quartz configuration/deployement because usually you do not have to insert/update those tables manually.

like image 29
willome Avatar answered Sep 22 '22 12:09

willome