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.
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 114
protected void
handleTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when running a transacted statement.
at line 176
void
beginTransaction()
Start a new database transaction.
at line 214
protected void
createTransaction()
Create a transaction within the database.
at line 234
protected void
handleBeginTransactionException(Throwable $e)
Handle an exception from a transaction beginning.
at line 250
void
commit()
Commit the active database transaction.
at line 294
protected void
handleCommitTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when committing a transaction.
at line 336
void
rollBack(int|null $toLevel = null)
Rollback the active database transaction.
at line 390
protected void
handleRollBackException(Throwable $e)
Handle an exception from a rollback.
at line 408
protected void
forgetLostConnection()
Forget a connection after a lost transaction operation.
at line 420
int
transactionLevel()
Get the number of active transactions.
at line 432
void
afterCommit(callable $callback)
Execute the callback after a transaction commits.
The callback belongs to this connection's open transaction stack.
at line 446
void
afterCommitOrNow(callable $callback)
Execute the callback after commit, or immediately when no transaction exists.
at line 464
void
afterRollBack(callable $callback)
Execute the callback after a transaction rolls back.
The callback belongs to this connection's open transaction stack.