java - Spring-MVC : Scheduled job did not execute -


i working on spring-mvc application in using scheduling delete stuff not necessary. unfortunately, scheduled method did not fire. can tell me did wrong.

here code :

@repository @transactional @enablescheduling public class notificationdaoimpl implements notificationdao{      @override     @scheduled(cron = "0 3 3 * * ?")     public void deletenotificationsautomagically(){         session=this.sessionfactory.getcurrentsession();         long = system.currenttimemillis();         long nowminus1week = - (1000 * 60 * 60 * 24 * 3);         timestamp nowminus1weekastimestamp = new timestamp(nowminus1week);         query query = session.createquery("delete notelock nl nl.timestamp < :limit , nl.read=:true");         query.setparameter("limit", nowminus1weekastimestamp);         query.executeupdate();         session.flush();     } } 

i know parameter name 1 week, deleting in 3 days. copied code .. :d nice. thanks.

that cron expression looks run @ 3 o' clock on 3rd of every month.

if want run every 3 minutes, can use below expression.

0 0/3 * 1/1 * ? *

you can use cronmaker generating expressions

to verify whether cron expressions create, visit page


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -