@Override public void rollbackTransaction(ConnectionContext context) throws IOException { longTermPersistence.rollbackTransaction(context); }
/** * @throws IOException */ public void commit() throws IOException { ConnectionContext ctx = new ConnectionContext(); persistenceAdapter.beginTransaction(ctx); try { // Do all the message adds. for (Iterator<AddMessageCommand> iter = messages.iterator(); iter.hasNext();) { AddMessageCommand cmd = iter.next(); cmd.run(ctx); } // And removes.. for (Iterator<RemoveMessageCommand> iter = acks.iterator(); iter.hasNext();) { RemoveMessageCommand cmd = iter.next(); cmd.run(ctx); } persistenceAdapter.commitTransaction(ctx); } catch (IOException e) { persistenceAdapter.rollbackTransaction(ctx); throw e; } } }
persistenceAdapter.rollbackTransaction(ctx); throw e;
public void run(Callback task) throws IOException { persistenceAdapter.beginTransaction(context); Throwable throwable = null; try { task.execute(); } catch (IOException t) { throwable = t; throw t; } catch (RuntimeException t) { throwable = t; throw t; } catch (Throwable t) { throwable = t; throw IOExceptionSupport.create("Persistence task failed: " + t, t); } finally { if (throwable == null) { persistenceAdapter.commitTransaction(context); } else { LOG.error("Having to Rollback - caught an exception: " + throwable); persistenceAdapter.rollbackTransaction(context); } } }
persistenceAdapter.rollbackTransaction(ctx); throw e;
@Override public void rollbackTransaction(ConnectionContext context) throws IOException { longTermPersistence.rollbackTransaction(context); }
@Override public void rollbackTransaction(ConnectionContext context) throws IOException { longTermPersistence.rollbackTransaction(context); }
@Override public void rollbackTransaction(ConnectionContext context) throws IOException { longTermPersistence.rollbackTransaction(context); }
public void rollbackTransaction(ConnectionContext context) throws IOException { longTermPersistence.rollbackTransaction(context); }
/** * @throws IOException */ public void commit() throws IOException { ConnectionContext ctx = new ConnectionContext(); persistenceAdapter.beginTransaction(ctx); try { // Do all the message adds. for (Iterator<AddMessageCommand> iter = messages.iterator(); iter.hasNext();) { AddMessageCommand cmd = iter.next(); cmd.run(ctx); } // And removes.. for (Iterator<RemoveMessageCommand> iter = acks.iterator(); iter.hasNext();) { RemoveMessageCommand cmd = iter.next(); cmd.run(ctx); } } catch (IOException e) { persistenceAdapter.rollbackTransaction(ctx); throw e; } persistenceAdapter.commitTransaction(ctx); } }
/** * @throws IOException */ public void commit() throws IOException { ConnectionContext ctx = new ConnectionContext(); persistenceAdapter.beginTransaction(ctx); try { // Do all the message adds. for (Iterator<AddMessageCommand> iter = messages.iterator(); iter.hasNext();) { AddMessageCommand cmd = iter.next(); cmd.run(ctx); } // And removes.. for (Iterator<RemoveMessageCommand> iter = acks.iterator(); iter.hasNext();) { RemoveMessageCommand cmd = iter.next(); cmd.run(ctx); } } catch (IOException e) { persistenceAdapter.rollbackTransaction(ctx); throw e; } persistenceAdapter.commitTransaction(ctx); } }
/** * @throws IOException */ public void commit() throws IOException { ConnectionContext ctx = new ConnectionContext(); persistenceAdapter.beginTransaction(ctx); try { // Do all the message adds. for (Iterator<AddMessageCommand> iter = messages.iterator(); iter.hasNext();) { AddMessageCommand cmd = iter.next(); cmd.run(ctx); } // And removes.. for (Iterator<RemoveMessageCommand> iter = acks.iterator(); iter.hasNext();) { RemoveMessageCommand cmd = iter.next(); cmd.run(ctx); } } catch (IOException e) { persistenceAdapter.rollbackTransaction(ctx); throw e; } persistenceAdapter.commitTransaction(ctx); } }
/** * @throws IOException */ public void commit() throws IOException { ConnectionContext ctx = new ConnectionContext(); persistenceAdapter.beginTransaction(ctx); try { // Do all the message adds. for (Iterator<AddMessageCommand> iter = messages.iterator(); iter.hasNext();) { AddMessageCommand cmd = iter.next(); cmd.run(ctx); } // And removes.. for (Iterator<RemoveMessageCommand> iter = acks.iterator(); iter.hasNext();) { RemoveMessageCommand cmd = iter.next(); cmd.run(ctx); } } catch ( IOException e ) { persistenceAdapter.rollbackTransaction(ctx); throw e; } persistenceAdapter.commitTransaction(ctx); } }
persistenceAdapter.rollbackTransaction(ctx); throw e;
public void run(Callback task) throws IOException { persistenceAdapter.beginTransaction(context); Throwable throwable = null; try { task.execute(); } catch (IOException t) { throwable = t; throw t; } catch (RuntimeException t) { throwable = t; throw t; } catch (Throwable t) { throwable = t; throw IOExceptionSupport.create("Persistence task failed: " + t, t); } finally { if (throwable == null) { persistenceAdapter.commitTransaction(context); } else { LOG.error("Having to Rollback - caught an exception: " + throwable); persistenceAdapter.rollbackTransaction(context); } } }
public void run(Callback task) throws IOException { persistenceAdapter.beginTransaction(context); Throwable throwable = null; try { task.execute(); } catch (IOException t) { throwable = t; throw t; } catch (RuntimeException t) { throwable = t; throw t; } catch (Throwable t) { throwable = t; throw IOExceptionSupport.create("Persistence task failed: " + t, t); } finally { if (throwable == null) { persistenceAdapter.commitTransaction(context); } else { LOG.error("Having to Rollback - caught an exception: " + throwable); persistenceAdapter.rollbackTransaction(context); } } }
public void run(Callback task) throws IOException { persistenceAdapter.beginTransaction(context); Throwable throwable = null; try { task.execute(); } catch (IOException t) { throwable = t; throw t; } catch (RuntimeException t) { throwable = t; throw t; } catch (Throwable t) { throwable = t; throw IOExceptionSupport.create("Persistence task failed: " + t, t); } finally { if (throwable == null) { persistenceAdapter.commitTransaction(context); } else { LOG.error("Having to Rollback - caught an exception: " + throwable); persistenceAdapter.rollbackTransaction(context); } } }
public void run(Callback task) throws IOException { persistenceAdapter.beginTransaction(context); Throwable throwable = null; try { task.execute(); } catch (IOException t) { throwable = t; throw t; } catch (RuntimeException t) { throwable = t; throw t; } catch (Throwable t) { throwable = t; throw IOExceptionSupport.create("Persistence task failed: " + t, t); } finally { if (throwable == null) { persistenceAdapter.commitTransaction(context); } else { LOG.error("Having to Rollback - caught an exception: " + throwable); persistenceAdapter.rollbackTransaction(context); } } }
persistenceAdapter.rollbackTransaction(ctx); throw e;
persistenceAdapter.rollbackTransaction(ctx); throw e;