Nov 26th, 2008, 07:27 AM
how can I trigger a job out of transaction?
Hello, I want to trigger some jobs after the transaction is commited, how I can do?
I try to use StepListenerSupport to do this, but all the after methods will be called before the transaction is committed except the afterStep method. But if I use afterStep method to trigger my job, it will be triggered once but not be triggered after each commit cycle.
Can spring batch provide other approach to handle this case?
Last edited by hhc_gz; Nov 27th, 2008 at 01:00 AM.
Nov 26th, 2008, 04:28 PM
It seems like you should be using some kind of scheduler to solve this.
Nov 27th, 2008, 01:04 AM
Scheduler? Can you give me more info for this?
Nov 27th, 2008, 02:37 AM
You want to launch a job after every commit? And block until it finishes (preventing the driver step from proceeding)? I suppose you could use a transactional ChunkListener with Propagation.REQUIRES_NEW?
Nov 28th, 2008, 02:11 AM
Did I say REQUIRES_NEW? I meant NOT_SUPPORTED. Still not sure why you would want to do that though.