ManagesTransactions
trait ManagesTransactions (View source)
Methods
TReturn
void
handleTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when running a transacted statement.
void
beginTransaction()
Start a new database transaction.
void
createTransaction()
Create a transaction within the database.
void
createSavepoint()
Create a save point within the database.
void
void
commit()
Commit the active database transaction.
void
handleCommitTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when committing a transaction.
void
rollBack(int|null $toLevel = null)
Rollback the active database transaction.
void
performRollBack(int $toLevel)
Perform a rollback within the database.
void
int
transactionLevel()
Get the number of active transactions.
void
afterCommit(callable $callback)
Execute the callback after a transaction commits.
Details
protected void
handleTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when running a transacted statement.
protected void
handleBeginTransactionException(Throwable $e)
Handle an exception from a transaction beginning.
protected void
handleCommitTransactionException(Throwable $e, int $currentAttempt, int $maxAttempts)
Handle an exception encountered when committing a transaction.