Transactional connection with savepoint support for nested transactions.
Savepoint semantics: nested transactions are emulated via SQL savepoints named zib_tx_1 .. zib_tx_N where N is the nesting depth. On success the savepoint is released via RELEASE SAVEPOINT, on failure the transaction rolls back to the savepoint via ROLLBACK TO SAVEPOINT and rethrows the exception. Only the outermost Transactor.transact does a real COMMIT/ROLLBACK; inner blocks are savepoint-scoped and share the same underlying JDBC connection.
Depth tracking: each DbTx instance tracks its current nesting depth (0 = outermost). The counter is incremented only after the savepoint is created successfully and decremented in a finally block, guaranteeing correct depth even if savepoint creation throws and reset even when inner blocks throw.
Attributes
- Companion
- object
- Source
- DbTx.scala
- Graph
-
- Supertypes