Class GraphTransactionManager
java.lang.Object
app.ductape.sdk.graph.transactions.GraphTransactionManager
TS parity for
transactions/transaction-manager.ts: lifecycle owner for a single
graph adapter's transactions.
Transaction status nuances (TS-aligned):
- Active transactions are tracked by id.
beginTransaction(Map)returns a copy withstatus="active". commitTransaction(Map)androllbackTransaction(Map)are idempotent no-ops once the transaction is no longer active (TS catches and swallows second-rollback errors, Java does the same).- If commit throws after the adapter has already started writing, we still try to roll
back the underlying database tx (TS
try { commit } catch { rollback; throw }). executeTransaction(Function, Map)mirrors TSsession.executeWrite(callback): errors thrown inside the callback trigger rollback and re-throw as aGraphError.transactionError(java.lang.String, java.lang.Throwable), with the original cause preserved.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginTransaction(Map<String, Object> options) voidcommitTransaction(Map<String, Object> transaction) <T> TgetTransactionStatus(String transactionId) TSgetTransactionStatus(tx): returns"active"when the manager owns the tx, otherwisenull.booleanisTransactionActive(String transactionId) booleanownsTransaction(String transactionId) voidvoidrollbackTransaction(Map<String, Object> transaction) voidsetAdapter(BaseGraphAdapter adapter)
-
Constructor Details
-
GraphTransactionManager
-
-
Method Details
-
setAdapter
-
executeTransaction
-
beginTransaction
-
commitTransaction
-
rollbackTransaction
-
getActiveTransactions
-
getTransactionStatus
TSgetTransactionStatus(tx): returns"active"when the manager owns the tx, otherwisenull. Thestatuskey on the returned tx map after commit/rollback is set in-place to"committed","rolled_back", or"failed". -
isTransactionActive
-
ownsTransaction
-
rollbackAll
public void rollbackAll()
-