Results 1 to 5 of 5

Thread: how can I trigger a job out of transaction?

  1. #1
    Join Date
    Apr 2008
    Posts
    9

    Default 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.

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    It seems like you should be using some kind of scheduler to solve this.

  3. #3
    Join Date
    Apr 2008
    Posts
    9

    Default

    Scheduler? Can you give me more info for this?

  4. #4
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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?

  5. #5
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    Did I say REQUIRES_NEW? I meant NOT_SUPPORTED. Still not sure why you would want to do that though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •