public void executeBatch() throws SQLException { try { executeBatch(addMessageStatement, "Failed add a message"); } finally { addMessageStatement = null; try { executeBatch(removedMessageStatement, "Failed to remove a message"); } finally { removedMessageStatement = null; try { executeBatch(updateLastAckStatement, "Failed to ack a message"); } finally { updateLastAckStatement = null; } } } }
public void close() throws IOException { if (!inTx) { try { // can be null for topic ops that bypass the store via existing cursor state if (connection != null) { final boolean needsCommit = !connection.getAutoCommit(); executeBatch(); if (needsCommit) { connection.commit(); } } } catch (SQLException e) { JDBCPersistenceAdapter.log("Error while closing connection: ", e); IOException ioe = IOExceptionSupport.create(e); persistenceAdapter.getBrokerService().handleIOException(ioe); throw ioe; } finally { silentClose(); for (Runnable completion: completions) { completion.run(); } completions.clear(); } } }
public void commit() throws IOException { if (!inTx) { throw new IOException("Not started."); } try { final boolean needsCommit = !connection.getAutoCommit(); executeBatch(); if (needsCommit) { connection.commit(); } } catch (SQLException e) { JDBCPersistenceAdapter.log("Commit failed: ", e); try { doRollback(); } catch (Exception ignored) {} IOException ioe = IOExceptionSupport.create(e); persistenceAdapter.getBrokerService().handleIOException(ioe); throw ioe; } finally { inTx = false; close(); } }
public void executeBatch() throws SQLException { try { executeBatch(addMessageStatement, "Failed add a message"); } finally { addMessageStatement = null; try { executeBatch(removedMessageStatement, "Failed to remove a message"); } finally { removedMessageStatement = null; try { executeBatch(updateLastAckStatement, "Failed to ack a message"); } finally { updateLastAckStatement = null; } } } }
public void executeBatch() throws SQLException { try { executeBatch(addMessageStatement, "Failed add a message"); } finally { addMessageStatement = null; try { executeBatch(removedMessageStatement, "Failed to remove a message"); } finally { removedMessageStatement = null; try { executeBatch(updateLastAckStatement, "Failed to ack a message"); } finally { updateLastAckStatement = null; } } } }
public void executeBatch() throws SQLException { try { executeBatch(addMessageStatement, "Failed add a message"); } finally { addMessageStatement = null; try { executeBatch(removedMessageStatement, "Failed to remove a message"); } finally { removedMessageStatement = null; try { executeBatch(updateLastAckStatement, "Failed to ack a message"); } finally { updateLastAckStatement = null; } } } }
public void executeBatch() throws SQLException { try { executeBatch(addMessageStatement, "Failed add a message"); } finally { addMessageStatement = null; try { executeBatch(removedMessageStatement, "Failed to remove a message"); } finally { removedMessageStatement = null; try { executeBatch(updateLastAckStatement, "Failed to ack a message"); } finally { updateLastAckStatement = null; } } } }
executeBatch(); } finally { if (connection != null && !connection.getAutoCommit()) {
public void commit() throws IOException { if (!inTx) { throw new IOException("Not started."); } try { executeBatch(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (SQLException e) { JDBCPersistenceAdapter.log("Commit failed: ", e); this.rollback(); throw IOExceptionSupport.create(e); } finally { inTx = false; close(); } }
executeBatch(); } finally { if (connection != null && !connection.getAutoCommit()) {
executeBatch(); } finally { if (connection != null && !connection.getAutoCommit()) {
executeBatch(); } finally { if (connection != null && !connection.getAutoCommit()) {
public void commit() throws IOException { if (!inTx) { throw new IOException("Not started."); } try { executeBatch(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (SQLException e) { JDBCPersistenceAdapter.log("Commit failed: ", e); try { doRollback(); } catch (Exception ignored) {} IOException ioe = IOExceptionSupport.create(e); persistenceAdapter.getBrokerService().handleIOException(ioe); throw ioe; } finally { inTx = false; close(); } }
public void commit() throws IOException { if (!inTx) { throw new IOException("Not started."); } try { executeBatch(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (SQLException e) { JDBCPersistenceAdapter.log("Commit failed: ", e); try { doRollback(); } catch (Exception ignored) {} IOException ioe = IOExceptionSupport.create(e); persistenceAdapter.getBrokerService().handleIOException(ioe); throw ioe; } finally { inTx = false; close(); } }
public void commit() throws IOException { if (!inTx) { throw new IOException("Not started."); } try { executeBatch(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (SQLException e) { JDBCPersistenceAdapter.log("Commit failed: ", e); try { doRollback(); } catch (Exception ignored) {} IOException ioe = IOExceptionSupport.create(e); persistenceAdapter.getBrokerService().handleIOException(ioe); throw ioe; } finally { inTx = false; close(); } }