| Author |
Message |
|
|
Why would anyone send you code?
As far as Quartz problem, you need to read how to configure CMT properly. The error you posed says Quartz can't find datasource under that JNDI binding name. So you need to verify that does indeed exists in your environment.
Also, as a side note, Tomcat is NOT an full JEE app server, so it doens't support XA (CMT), so there is no reason you make Quartz to use JobStoreCMT. Again check the quartz site doc for config settings.
|
 |
|
|
Stop hustling. This is a public forum. You will get help as people are willing. You will get better answer when you show more of your own effort.
If you would spent the week reading on Quartz's tutorial, reference and API, you would be an expert by now. But reading your attached example, you seem to be clueless about how Quartz works. So my suggestion is start your second week from here: http://quartz-scheduler.org/documentation/quartz-2.x/tutorials. There are pretty of examples in the zip distribution.
Post your Quartz specific problem with code, clear question, config etc. Not your swing or clock, which other have no interest in.
|
 |
|
|
Thank you for the patch ljb26. I have implemented this featured into our 2.0.x branch with similar what you provided. Unfortunately we can't apply your patch directly since there are other issue that we need to address at the same time. See https://jira.terracotta.org/jira/browse/QTZ-202
What you may certainly continue to help to test it for us! You may wait for next release, or grap the branch code and build to see if it works for you.
|
 |
|
|
Well, why not just pick the right method in the first place such as?
repeatMinutelyForever(15)
The other method you choose is for people who is customize it, so you should know what you are customizing in the first place. (Javadoc already given example that you need to set repeatForever() in this case.)
|
 |
|
|
So having a job with a cron trigger and then calling it on demand via "triggerJob" or "triggerJobWithVolatileTrigger" as needed would be the correct approach, right?
YES.
Are there any other considerations when manipulating a job in this manner?
NO. The scheduler API is for use in that purpose, so use it.
Any possible foreseen issues?
NO. I don't see any, but who knows...
|
 |
|
|
You are still not clear.
Are you saying you want to setup a trigger that fires every 5 mins, but if your job execution run lasted longer than 5 minutes, you want to skip the next run? If this case you can try the SimpleTrigger .MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT.
If all you need is to run a job every 5 mins, the SimpleTrigger will work, why it must be CronTrigger? But if must, CronTrigger also has it's misfire instruction too. Consult the API.
|
 |
|
|
|
I don't understand your schedule need. Give some future fire times examples and its pattern as when your job needs to be run. What you said is unclear.
|
 |
|
|
|
Then what do you mean you need "fixed-delay" mode? Describe your schedule need.
|
 |
|
|
sure, in your job, you have execute(JobSchedulerContext ctx) method, so just call ctx.getSheduler().unscheduleJob(trigerName, triggerGroup)
or you can deleteJob(jobName, jobGroup) for all related triggers.
|
 |
|
|
Is quartz jar in your classpath?
Also, your demo will likely not work because you went scheduler a job 60 secs in future, but then shutdown it immediately afterward. You will never see your job executed. Try put Thread.sleep(70*1000L); before shutdown. In real situation, Quartz is intend to run continually as a server background process.
|
 |
|
|
Quartz is Java based, and it can runs on any Java platform that the OS supports it. Linux is definitely one of them!
You probably don't have Java installed correctly in your OS. What version/vendor do you have? If you do, then check to ensure you have your log output correctly configured, and share it here along with your quartz config.
|
 |
|
|
If the two jobs are from the same Job class, then you can use @DisallowConcurrentExecution. Other wise, you would have to synchronize the execution in your own job's execution method.
You can get fixed interval triggering using SimpleTrigger.
|
 |
|
|
|
The "scheduler.triggerJob" is a the "on demand" fire of your trigger. There is another version of called "triggerJobWithVolatileTrigger" if you don't even want your trigger to persist into the store at all. Really transient.
|
 |
|
|
|
I don't understand your code snippet. If you are dealing with custom class loading, shouldn't you be working with a custom ClassLoaderHelper in quartz and set that in your quartz config: org.quartz.scheduler.classLoadHelper.class ?
|
 |
|
|
Are you experiencing "DB user account lock", or "DB lock"? I think the DDL hints is for the later.
If it's just user account lock, ensure you have the right user/password in the quartz config.
|
 |
|
|