/** * <p> * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} * </code> to obtain instances of <code> * {@link org.quartz.core.JobRunShell}</code>. * </p> */ public JobRunShell createJobRunShell(TriggerFiredBundle bundle) throws SchedulerException { return new JTAJobRunShell(scheduler, bundle); }
@Override protected void begin() throws SchedulerException { // Don't get a new UserTransaction w/o making sure we cleaned up the old // one. This is necessary because there are paths through JobRunShell.run() // where begin() can be called multiple times w/o complete being called in // between. cleanupUserTransaction(); boolean beganSuccessfully = false; try { getLog().debug("Looking up UserTransaction."); ut = UserTransactionHelper.lookupUserTransaction(); if (transactionTimeout != null) { ut.setTransactionTimeout(transactionTimeout); } getLog().debug("Beginning UserTransaction."); ut.begin(); beganSuccessfully = true; } catch (SchedulerException se) { throw se; } catch (Exception nse) { throw new SchedulerException( "JTAJobRunShell could not start UserTransaction.", nse); } finally { if (beganSuccessfully == false) { cleanupUserTransaction(); } } }
/** * Override passivate() to ensure we always cleanup the UserTransaction. */ @Override public void passivate() { cleanupUserTransaction(); super.passivate(); }
/** * Override passivate() to ensure we always cleanup the UserTransaction. */ @Override public void passivate() { cleanupUserTransaction(); super.passivate(); }
@Override protected void begin() throws SchedulerException { // Don't get a new UserTransaction w/o making sure we cleaned up the old // one. This is necessary because there are paths through JobRunShell.run() // where begin() can be called multiple times w/o complete being called in // between. cleanupUserTransaction(); boolean beganSuccessfully = false; try { getLog().debug("Looking up UserTransaction."); ut = UserTransactionHelper.lookupUserTransaction(); if (transactionTimeout != null) { ut.setTransactionTimeout(transactionTimeout); } getLog().debug("Beginning UserTransaction."); ut.begin(); beganSuccessfully = true; } catch (SchedulerException se) { throw se; } catch (Exception nse) { throw new SchedulerException( "JTAJobRunShell could not start UserTransaction.", nse); } finally { if (beganSuccessfully == false) { cleanupUserTransaction(); } } }
/** * <p> * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} * </code> to obtain instances of <code> * {@link org.quartz.core.JobRunShell}</code>. * </p> */ public JobRunShell createJobRunShell(TriggerFiredBundle bundle) throws SchedulerException { return new JTAJobRunShell(scheduler, bundle); }
/** * Override passivate() to ensure we always cleanup the UserTransaction. */ public void passivate() { cleanupUserTransaction(); super.passivate(); }
try { if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) { getLog().debug("UserTransaction marked for rollback only."); successfulExecution = false; getLog().debug("Committing UserTransaction."); ut.commit(); } catch (Exception nse) { getLog().debug("Rolling-back UserTransaction."); ut.rollback(); } catch (Exception nse) { cleanupUserTransaction();
/** * <p> * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} * </code> to obtain instances of <code> * {@link org.quartz.core.JobRunShell}</code>. * </p> */ public JobRunShell createJobRunShell(TriggerFiredBundle bundle) throws SchedulerException { ExecuteInJTATransaction jtaAnnotation = ClassUtils.getAnnotation(bundle.getJobDetail().getJobClass(), ExecuteInJTATransaction.class); if(jtaAnnotation == null) return new JobRunShell(scheduler, bundle); else { int timeout = jtaAnnotation.timeout(); if (timeout >= 0) { return new JTAJobRunShell(scheduler, bundle, timeout); } else { return new JTAJobRunShell(scheduler, bundle); } } }
/** * Override passivate() to ensure we always cleanup the UserTransaction. */ public void passivate() { cleanupUserTransaction(); super.passivate(); }
try { if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) { getLog().debug("UserTransaction marked for rollback only."); successfulExecution = false; getLog().debug("Committing UserTransaction."); ut.commit(); } catch (Exception nse) { getLog().debug("Rolling-back UserTransaction."); ut.rollback(); } catch (Exception nse) { cleanupUserTransaction();
/** * <p> * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} * </code> to obtain instances of <code> * {@link org.quartz.core.JobRunShell}</code>. * </p> */ public JobRunShell createJobRunShell(TriggerFiredBundle bundle) throws SchedulerException { ExecuteInJTATransaction jtaAnnotation = ClassUtils.getAnnotation(bundle.getJobDetail().getJobClass(), ExecuteInJTATransaction.class); if(jtaAnnotation == null) return new JobRunShell(scheduler, bundle); else { int timeout = jtaAnnotation.timeout(); if (timeout >= 0) { return new JTAJobRunShell(scheduler, bundle, timeout); } else { return new JTAJobRunShell(scheduler, bundle); } } }
protected void begin() throws SchedulerException { // Don't get a new UserTransaction w/o making sure we cleaned up the old // one. This is necessary because there are paths through JobRunShell.run() // where begin() can be called multiple times w/o complete being called in // between. cleanupUserTransaction(); boolean beganSuccessfully = false; try { getLog().debug("Looking up UserTransaction."); ut = UserTransactionHelper.lookupUserTransaction(); getLog().debug("Beginning UserTransaction."); ut.begin(); beganSuccessfully = true; } catch (SchedulerException se) { throw se; } catch (Exception nse) { throw new SchedulerException( "JTAJobRunShell could not start UserTransaction.", nse); } finally { if (beganSuccessfully == false) { cleanupUserTransaction(); } } }
/** * <p> * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} * </code> to obtain instances of <code> * {@link org.quartz.core.JobRunShell}</code>. * </p> */ public JobRunShell borrowJobRunShell() { return new JTAJobRunShell(this, scheduler, schedCtxt); }
protected void begin() throws SchedulerException { // Don't get a new UserTransaction w/o making sure we cleaned up the old // one. This is necessary because there are paths through JobRunShell.run() // where begin() can be called multiple times w/o complete being called in // between. cleanupUserTransaction(); boolean beganSuccessfully = false; try { getLog().debug("Looking up UserTransaction."); ut = UserTransactionHelper.lookupUserTransaction(); getLog().debug("Beginning UserTransaction."); ut.begin(); beganSuccessfully = true; } catch (SchedulerException se) { throw se; } catch (Exception nse) { throw new SchedulerException( "JTAJobRunShell could not start UserTransaction.", nse); } finally { if (beganSuccessfully == false) { cleanupUserTransaction(); } } }
/** * <p> * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} * </code> to obtain instances of <code> * {@link org.quartz.core.JobRunShell}</code>. * </p> */ public JobRunShell borrowJobRunShell() { return new JTAJobRunShell(this, scheduler, schedCtxt); }
try { if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) { getLog().debug("UserTransaction marked for rollback only."); successfulExecution = false; getLog().debug("Committing UserTransaction."); ut.commit(); } catch (Exception nse) { getLog().debug("Rolling-back UserTransaction."); ut.rollback(); } catch (Exception nse) { cleanupUserTransaction();
try { if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) { getLog().debug("UserTransaction marked for rollback only."); successfulExecution = false; getLog().debug("Committing UserTransaction."); ut.commit(); } catch (Exception nse) { getLog().debug("Rolling-back UserTransaction."); ut.rollback(); } catch (Exception nse) { cleanupUserTransaction();