Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4435

Timers fail when ContainerManagedTransactions are being used

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • jBPM 6.2.0.Final
    • jBPM 6.1.0.Final
    • Runtime Engine
    • None
    • 0
    • 0% 0%

    Description

      When container managed transactions are selected, no transaction is present when a timer is fired, causing an exception to be thrown.

      Workaround:

      Extend ThreadPoolSchedulerService, overriding internalSchedule(), wrapping Callable item in a callable that will wrap the call in a transaction. This service must then be set in the RuntimeEngineBuilder.

      i.e.:

      private class TxCallable implements Callable<Void> {
      		
      		private Callable<?> delegate;
      		
      		public TxCallable(Callable<?> delegate) {
      			this.delegate = delegate;
      		}
      
      		@Override
      		public Void call() throws Exception {
      			ut.begin();
      			try {
      				delegate.call();
      				
      				ut.commit();
      			} catch (Exception e) {
      				ut.rollback();
      			}
      			return null;
      		}
      		
      	}
      

      Attachments

        Issue Links

          Activity

            People

              swiderski.maciej Maciej Swiderski (Inactive)
              jblinick_jira Josh B (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: