ManagesTransactions
trait ManagesTransactions mixin Connection
Methods
Handle an exception encountered when running a transacted statement.
Start a new database transaction.
Create a transaction within the database.
Commit the active database transaction.
Handle an exception encountered when committing a transaction.
Rollback the active database transaction.
Forget a connection after a lost transaction operation.
Get the number of active transactions.
Determine whether this connection has a transaction that delays after-commit callbacks.
Execute the callback after a transaction commits.
Execute the callback after commit, or immediately when no transaction exists.
Execute the callback after a transaction rolls back.
Details
at line 30
mixed
transaction(Closure $callback, int $attempts = 1)
No description
at line 129
protected void
handleTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when running a transacted statement.
at line 177
void
beginTransaction()
Start a new database transaction.
at line 215
protected void
createTransaction()
Create a transaction within the database.
at line 235
protected void
handleBeginTransactionException(Throwable $e)
Handle an exception from a transaction beginning.
at line 251
void
commit()
Commit the active database transaction.
at line 299
protected void
handleCommitTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when committing a transaction.
at line 342
void
rollBack(int|null $toLevel = null)
Rollback the active database transaction.
at line 413
protected void
handleRollBackException(Throwable $e)
Handle an exception from a rollback.
at line 433
protected void
forgetLostConnection()
Forget a connection after a lost transaction operation.
at line 450
int
transactionLevel()
Get the number of active transactions.
at line 460
bool
hasApplicableTransaction()
Determine whether this connection has a transaction that delays after-commit callbacks.
Without a transaction manager, any open transaction counts.
at line 476
void
afterCommit(callable $callback)
Execute the callback after a transaction commits.
The callback belongs to this connection's open transaction stack.
at line 490
void
afterCommitOrNow(callable $callback)
Execute the callback after commit, or immediately when no transaction exists.
at line 508
void
afterRollBack(callable $callback)
Execute the callback after a transaction rolls back.
The callback belongs to this connection's open transaction stack.