Search in sources :

Example 1 with WriteBackendTransaction

use of com.torodb.core.backend.WriteBackendTransaction in project torodb by torodb.

the class DefaultConsistencyHandler method flushConsistentState.

private Object flushConsistentState(BackendConnection conn) throws RetrierAbortException {
    try (WriteBackendTransaction trans = conn.openSharedWriteTransaction()) {
        trans.writeMetaInfo(CONSISTENCY_KEY, KvBoolean.from(consistent));
        trans.commit();
    } catch (UserException ex) {
        throw new RetrierAbortException(ex);
    }
    return null;
}
Also used : RetrierAbortException(com.torodb.core.retrier.RetrierAbortException) UserException(com.torodb.core.exceptions.user.UserException) WriteBackendTransaction(com.torodb.core.backend.WriteBackendTransaction)

Aggregations

WriteBackendTransaction (com.torodb.core.backend.WriteBackendTransaction)1 UserException (com.torodb.core.exceptions.user.UserException)1 RetrierAbortException (com.torodb.core.retrier.RetrierAbortException)1