ManagesTransactions
trait ManagesTransactions (View source)
Shares nested transaction bookkeeping while issuing physical boundaries only for the outermost scope.
Methods
Disables transaction entry points for the consuming connection.
Controls whether a failed transaction keeps the connection in failed status for later transaction groups.
Starts a managed transaction group, optionally forcing rollback during completion for test mode.
Commits a successful group or rolls it back after a recorded failure.
Reports whether the current transaction group has remained successful.
Reports whether this connection has one or more managed transaction scopes open.
Enters a transaction scope, issuing a physical BEGIN only for the outermost scope.
Leaves a transaction scope, issuing a physical commit only when the outermost scope completes.
Leaves a transaction scope, issuing a physical rollback only when the outermost scope completes.
Marks the current transaction group failed so completion rolls it back.
Starts the driver's physical transaction boundary for the outermost managed scope.
Commits the driver's physical transaction boundary for the outermost managed scope.
Rolls back the driver's physical transaction boundary for the outermost managed scope.
Details
trans_off
void
trans_off()
Disables transaction entry points for the consuming connection.
trans_strict
void
trans_strict(bool $mode = true)
Controls whether a failed transaction keeps the connection in failed status for later transaction groups.
trans_start
bool
trans_start(bool $testMode = false)
Starts a managed transaction group, optionally forcing rollback during completion for test mode.
trans_complete
bool
trans_complete()
Commits a successful group or rolls it back after a recorded failure.
trans_status
bool
trans_status()
Reports whether the current transaction group has remained successful.
trans_active
bool
trans_active()
Reports whether this connection has one or more managed transaction scopes open.
trans_begin
bool
trans_begin(bool $testMode = false)
Enters a transaction scope, issuing a physical BEGIN only for the outermost scope.
trans_commit
bool
trans_commit()
Leaves a transaction scope, issuing a physical commit only when the outermost scope completes.
trans_rollback
bool
trans_rollback()
Leaves a transaction scope, issuing a physical rollback only when the outermost scope completes.
markTransactionFailure
protected void
markTransactionFailure()
Marks the current transaction group failed so completion rolls it back.
beginTransaction
abstract protected void
beginTransaction()
Starts the driver's physical transaction boundary for the outermost managed scope.
commitTransaction
abstract protected void
commitTransaction()
Commits the driver's physical transaction boundary for the outermost managed scope.
rollbackTransaction
abstract protected void
rollbackTransaction()
Rolls back the driver's physical transaction boundary for the outermost managed scope.