/** * Calls {@link #flushUpdates()} before forwarding the call to the wrapped connection. */ @Override public void commit() throws SailException { flushUpdates(); super.commit(); }
@Override public void close() throws SailException { if (closed.compareAndSet(false, true)) { super.close(); } }
/** * Gets the connection that is wrapped by this object. * * @return The connection that was supplied to the constructor of this class. */ @Override public InferencerConnection getWrappedConnection() { return (InferencerConnection)super.getWrappedConnection(); }
@Override public void rollback() throws SailException { synchronized (sail) { previousStateConnection.commit(); cleanup(); super.rollback(); } }
@Override public void begin(IsolationLevel level) throws SailException { assert addedStatements == null; assert removedStatements == null; stats = new Stats(); // start two transactions, synchronize on underlying sail so that we get two transactions immediatly successivley synchronized (sail){ super.begin(level); previousStateConnection.begin(IsolationLevels.SNAPSHOT); } }
/** * Calls {@link #flushUpdates()} before forwarding the call to the wrapped connection. */ @Override public CloseableIteration<? extends BindingSet, QueryEvaluationException> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException { flushUpdates(); return super.evaluate(tupleExpr, dataset, bindings, includeInferred); }
/** * {@inheritDoc } */ @Override public synchronized void removeStatements(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException { super.removeStatements(subj, pred, obj, contexts); }
@Override public synchronized void addStatement(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException { super.addStatement(subj, pred, obj, contexts); }
@Override public synchronized void clear(Resource... resources) throws SailException { // remove the connection listener, this is safe as the changing methods // are synchronized // during the clear(), no other operation can be invoked getWrappedConnection().removeConnectionListener(connectionListener); try { super.clear(resources); buffer.clear(resources); } finally { getWrappedConnection().addConnectionListener(connectionListener); } }
@Override public void rollback() throws SailException { synchronized (sail) { previousStateConnection.commit(); cleanup(); super.rollback(); } }
@Override public void begin(IsolationLevel level) throws SailException { assert addedStatements == null; assert removedStatements == null; stats = new Stats(); // start two transactions, synchronize on underlying sail so that we get two transactions immediatly successivley synchronized (sail){ super.begin(level); previousStateConnection.begin(IsolationLevels.SNAPSHOT); } }
return super.evaluate(tupleExpr, dataset, bindings, includeInferred);
@Override public synchronized void removeStatements(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException { super.removeStatements(subj, pred, obj, contexts); }
@Override public synchronized void addStatement(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException { super.addStatement(subj, pred, obj, contexts); }
@Override public synchronized void clear(Resource... contexts) throws SailException { // remove the connection listener, this is safe as the changing methods // are synchronized // during the clear(), no other operation can be invoked getWrappedConnection().removeConnectionListener(connectionListener); try { super.clear(contexts); buffer.clear(contexts); } finally { getWrappedConnection().addConnectionListener(connectionListener); } }
throws SailException super.commit();
@Override public void close() throws SailException { if (closed.compareAndSet(false, true)) { super.close(); } }
@Override public void rollback() throws SailException { super.rollback(); buffer.reset(); try { luceneIndex.rollback(); } catch (IOException e) { throw new SailException(e); } } }
@Override public void begin() throws SailException { super.begin(); buffer.reset(); try { luceneIndex.begin(); } catch (IOException e) { throw new SailException(e); } }
/** * Removes the given listener from the wrapped connection. */ @Override public void removeConnectionListener(SailConnectionListener listener) { getWrappedConnection().removeConnectionListener(listener); } }