/** * If <em>wrapInUserTransaction</em> is true, starts a new UserTransaction * and returns it. Otherwise, or if establishing the transaction fail, it * will return null. */ private UserTransaction startUserTransaction() { if (wrapInUserTransaction == false) { return null; } UserTransaction userTransaction = null; try { userTransaction = UserTransactionHelper.lookupUserTransaction(); userTransaction.begin(); } catch (Throwable t) { UserTransactionHelper.returnUserTransaction(userTransaction); userTransaction = null; getLog().error("Failed to start UserTransaction for plugin: " + getName(), t); } return userTransaction; }
private void cleanupUserTransaction() { if (ut != null) { UserTransactionHelper.returnUserTransaction(ut); ut = null; } } }
@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(); } } }
UserTransactionHelper.setUserTxLocation(userTXLocation);
private void cleanupUserTransaction() { if (ut != null) { UserTransactionHelper.returnUserTransaction(ut); ut = null; } } }
@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(); } } }
UserTransactionHelper.setUserTxLocation(userTXLocation);
/** * If <em>wrapInUserTransaction</em> is true, starts a new UserTransaction * and returns it. Otherwise, or if establishing the transaction fail, it * will return null. */ private UserTransaction startUserTransaction() { if (wrapInUserTransaction == false) { return null; } UserTransaction userTransaction = null; try { userTransaction = UserTransactionHelper.lookupUserTransaction(); userTransaction.begin(); } catch (Throwable t) { UserTransactionHelper.returnUserTransaction(userTransaction); userTransaction = null; getLog().error("Failed to start UserTransaction for plugin: " + getName(), t); } return userTransaction; }
/** * If the given UserTransaction is not null, it is committed/rolledback, * and then returned to the UserTransactionHelper. */ private void resolveUserTransaction(UserTransaction userTransaction) { if (userTransaction != null) { try { if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { userTransaction.rollback(); } else { userTransaction.commit(); } } catch (Throwable t) { getLog().error("Failed to resolve UserTransaction for plugin: " + getName(), t); } finally { UserTransactionHelper.returnUserTransaction(userTransaction); } } } }
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(); } } }
UserTransactionHelper.setUserTxLocation(userTXLocation);
/** * If <em>wrapInUserTransaction</em> is true, starts a new UserTransaction * and returns it. Otherwise, or if establishing the transaction fail, it * will return null. */ private UserTransaction startUserTransaction() { if (wrapInUserTransaction == false) { return null; } UserTransaction userTransaction = null; try { userTransaction = UserTransactionHelper.lookupUserTransaction(); userTransaction.begin(); } catch (Throwable t) { UserTransactionHelper.returnUserTransaction(userTransaction); userTransaction = null; getLog().error("Failed to start UserTransaction for plugin: " + getName(), t); } return userTransaction; }
/** * If the given UserTransaction is not null, it is committed/rolledback, * and then returned to the UserTransactionHelper. */ private void resolveUserTransaction(UserTransaction userTransaction) { if (userTransaction != null) { try { if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { userTransaction.rollback(); } else { userTransaction.commit(); } } catch (Throwable t) { getLog().error("Failed to resolve UserTransaction for plugin: " + getName(), t); } finally { UserTransactionHelper.returnUserTransaction(userTransaction); } } } }
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(); } } }
UserTransactionHelper.setUserTxLocation(userTXLocation);
/** * If <em>wrapInUserTransaction</em> is true, starts a new UserTransaction * and returns it. Otherwise, or if establishing the transaction fail, it * will return null. */ private UserTransaction startUserTransaction() { if (wrapInUserTransaction == false) { return null; } UserTransaction userTransaction = null; try { userTransaction = UserTransactionHelper.lookupUserTransaction(); userTransaction.begin(); } catch (Throwable t) { UserTransactionHelper.returnUserTransaction(userTransaction); userTransaction = null; getLog().error("Failed to start UserTransaction for plugin: " + getName(), t); } return userTransaction; }
private void cleanupUserTransaction() { if (ut != null) { UserTransactionHelper.returnUserTransaction(ut); ut = null; } } }
private void cleanupUserTransaction() { if (ut != null) { UserTransactionHelper.returnUserTransaction(ut); ut = null; } } }
/** * If the given UserTransaction is not null, it is committed/rolledback, * and then returned to the UserTransactionHelper. */ private void resolveUserTransaction(UserTransaction userTransaction) { if (userTransaction != null) { try { if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { userTransaction.rollback(); } else { userTransaction.commit(); } } catch (Throwable t) { getLog().error("Failed to resolve UserTransaction for plugin: " + getName(), t); } finally { UserTransactionHelper.returnUserTransaction(userTransaction); } } } }
/** * If the given UserTransaction is not null, it is committed/rolledback, * and then returned to the UserTransactionHelper. */ private void resolveUserTransaction(UserTransaction userTransaction) { if (userTransaction != null) { try { if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { userTransaction.rollback(); } else { userTransaction.commit(); } } catch (Throwable t) { getLog().error("Failed to resolve UserTransaction for plugin: " + getName(), t); } finally { UserTransactionHelper.returnUserTransaction(userTransaction); } } } }