private void ensureTransactionStarted() { if(data == null) { log.warn("transaction was not properly started, autostarting; please consider using connection.begin() explicitly!"); data = new TransactionData(); } } }
private void ensureTransactionStarted() { if(data == null) { log.warn("transaction was not properly started, autostarting; please consider using connection.begin() explicitly!"); data = new TransactionData(); } } }
@Override public void begin() throws SailException { super.begin(); // start new transaction data = new TransactionData(); }
@Override public void begin() throws SailException { super.begin(); // start new transaction data = new TransactionData(); }
/** * Notify the listeners after rolling back. * @throws SailException */ @Override public void rollback() throws SailException { // perform rollback super.rollback(); // notify rollback listeners for(TransactionListener l : listeners) { l.rollback(data); } // empty transaction data data = new TransactionData(); }
/** * Notify the listeners after rolling back. * @throws SailException */ @Override public void rollback() throws SailException { // perform rollback super.rollback(); // notify rollback listeners for(TransactionListener l : listeners) { l.rollback(data); } // empty transaction data data = new TransactionData(); }
/** * Notify the listeners of a commit before and after calling the super method * @throws SailException */ @Override public void commit() throws SailException { // notify only if there is actually any data if(data != null && data.getAddedTriples().size() + data.getRemovedTriples().size() > 0) { data.setCommitTime(new Date()); // notify beforeCommit listeners for(TransactionListener l : listeners) { l.beforeCommit(data); } // perform commit super.commit(); // notify afterCommit listeners for(TransactionListener l : listeners) { l.afterCommit(data); } } else { super.commit(); } // empty transaction data data = new TransactionData(); }
/** * Notify the listeners of a commit before and after calling the super method * @throws SailException */ @Override public void commit() throws SailException { // notify only if there is actually any data if(data != null && data.getAddedTriples().size() + data.getRemovedTriples().size() > 0) { data.setCommitTime(new Date()); // notify beforeCommit listeners for(TransactionListener l : listeners) { l.beforeCommit(data); } // perform commit super.commit(); // notify afterCommit listeners for(TransactionListener l : listeners) { l.afterCommit(data); } } else { super.commit(); } // empty transaction data data = new TransactionData(); }