@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() { List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor()); defaultCommandInterceptorsTxRequiresNew.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequiresNew.add(new JtaTransactionInterceptor(transactionManager, true)); defaultCommandInterceptorsTxRequiresNew.add(new CommandContextInterceptor(commandContextFactory, this, true)); return defaultCommandInterceptorsTxRequiresNew; }
public <T> T execute(Command<T> command) { Transaction oldTx = null; try { boolean existing = isExisting(); boolean isNew = !existing || requiresNew; if (existing && requiresNew) { oldTx = doSuspend(); doBegin(); result = next.execute(command); } catch (RuntimeException ex) { doRollback(isNew); throw ex; } catch (Error err) { doRollback(isNew); throw err; } catch (Exception ex) { doRollback(isNew); throw new UndeclaredThrowableException(ex, "TransactionCallback threw undeclared checked exception"); doCommit(); doResume(oldTx);
private void doCommit() { try { transactionManager.commit(); } catch (HeuristicMixedException e) { throw new TransactionException("Unable to commit transaction", e); } catch (HeuristicRollbackException e) { throw new TransactionException("Unable to commit transaction", e); } catch (RollbackException e) { throw new TransactionException("Unable to commit transaction", e); } catch (SystemException e) { throw new TransactionException("Unable to commit transaction", e); } catch (RuntimeException e) { doRollback(true); throw e; } catch (Error e) { doRollback(true); throw e; } }
private void doCommit() { try { transactionManager.commit(); } catch (HeuristicMixedException e) { throw new TransactionException("Unable to commit transaction", e); } catch (HeuristicRollbackException e) { throw new TransactionException("Unable to commit transaction", e); } catch (RollbackException e) { throw new TransactionException("Unable to commit transaction", e); } catch (SystemException e) { throw new TransactionException("Unable to commit transaction", e); } catch (RuntimeException e) { doRollback(true); throw e; } catch (Error e) { doRollback(true); throw e; } }
public <T> T execute(Command<T> command) { Transaction oldTx = null; try { boolean existing = isExisting(); boolean isNew = !existing || requiresNew; if (existing && requiresNew) { oldTx = doSuspend(); doBegin(); result = next.execute(command); } catch (RuntimeException ex) { doRollback(isNew); throw ex; } catch (Error err) { doRollback(isNew); throw err; } catch (Exception ex) { doRollback(isNew); throw new UndeclaredThrowableException(ex, "TransactionCallback threw undeclared checked exception"); doCommit(); doResume(oldTx);
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() { List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequired.add(new LogInterceptor()); defaultCommandInterceptorsTxRequired.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequired.add(new JtaTransactionInterceptor(transactionManager, false)); defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this)); return defaultCommandInterceptorsTxRequired; }
private void doCommit() { try { transactionManager.commit(); } catch (HeuristicMixedException e) { throw new TransactionException("Unable to commit transaction", e); } catch (HeuristicRollbackException e) { throw new TransactionException("Unable to commit transaction", e); } catch (RollbackException e) { throw new TransactionException("Unable to commit transaction", e); } catch (SystemException e) { throw new TransactionException("Unable to commit transaction", e); } catch (RuntimeException e) { doRollback(true); throw e; } catch (Error e) { doRollback(true); throw e; } }
public <T> T execute(Command<T> command) { Transaction oldTx = null; try { boolean existing = isExisting(); boolean isNew = !existing || requiresNew; if (existing && requiresNew) { oldTx = doSuspend(); doBegin(); result = next.execute(command); } catch (RuntimeException ex) { doRollback(isNew); throw ex; } catch (Error err) { doRollback(isNew); throw err; } catch (Exception ex) { doRollback(isNew); throw new UndeclaredThrowableException(ex, "TransactionCallback threw undeclared checked exception"); doCommit(); doResume(oldTx);
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() { List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor()); defaultCommandInterceptorsTxRequiresNew.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequiresNew.add(new JtaTransactionInterceptor(transactionManager, true)); defaultCommandInterceptorsTxRequiresNew.add(new CommandContextInterceptor(commandContextFactory, this, true)); return defaultCommandInterceptorsTxRequiresNew; }
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() { List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequired.add(new LogInterceptor()); defaultCommandInterceptorsTxRequired.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequired.add(new JtaTransactionInterceptor(transactionManager, false)); defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this)); return defaultCommandInterceptorsTxRequired; }
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() { List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor()); defaultCommandInterceptorsTxRequiresNew.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequiresNew.add(new JtaTransactionInterceptor(transactionManager, true)); defaultCommandInterceptorsTxRequiresNew.add(new CommandContextInterceptor(commandContextFactory, this, true)); return defaultCommandInterceptorsTxRequiresNew; }
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() { List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequired.add(new LogInterceptor()); defaultCommandInterceptorsTxRequired.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequired.add(new JtaTransactionInterceptor(transactionManager, false)); defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this)); return defaultCommandInterceptorsTxRequired; }