Interface TxDatabaseAdapter.LoopOp
-
- Enclosing class:
- TxDatabaseAdapter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface TxDatabaseAdapter.LoopOp
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.projectnessie.versioned.persist.tx.TxDatabaseAdapter.OpResultapply(ConnectionWrapper conn, org.projectnessie.versioned.Hash targetRefHead)Applies an operation within a CAS-loop.
-
-
-
Method Detail
-
apply
org.projectnessie.versioned.persist.tx.TxDatabaseAdapter.OpResult apply(ConnectionWrapper conn, org.projectnessie.versioned.Hash targetRefHead) throws org.projectnessie.versioned.VersionStoreException, java.sql.SQLException
Applies an operation within a CAS-loop. The implementation gets the current global-state and must return an updated global-state with a different global-id.- Parameters:
conn- current JDBC connectiontargetRefHead- current named-reference's HEAD- Returns:
- if non-
* null, the JDBC transaction is committed and the hash returned fromTxDatabaseAdapter.opLoop(String, NamedRef, boolean, LoopOp, Supplier, Supplier). Ifnull, theopLoop()tries again. - Throws:
RetryTransactionException- (seeTxDatabaseAdapter.isRetryTransaction(SQLException)), the current JDBC transaction is rolled back andTxDatabaseAdapter.opLoop(String, NamedRef, boolean, LoopOp, Supplier, Supplier)tries againjava.sql.SQLException- if this matchesTxDatabaseAdapter.isIntegrityConstraintViolation(Throwable), the exception is re-thrown as aReferenceConflictExceptionorg.projectnessie.versioned.VersionStoreException- any other version-store exception- See Also:
TxDatabaseAdapter.opLoop(String, NamedRef, boolean, LoopOp, Supplier, Supplier)
-
-