\think\db\concernTransaction

事务支持

Summary

Methods
Properties
Constants
transactionXa()
transaction()
startTrans()
commit()
rollback()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

transactionXa()

transactionXa(callable  $callback, array  $dbs = []) : mixed

执行数据库Xa事务

Parameters

callable $callback

数据操作方法回调

array $dbs

多个查询对象或者连接对象

Throws

\think\db\concern\PDOException
\Exception
\Throwable

Returns

mixed —

transaction()

transaction(callable  $callback) : mixed

执行数据库事务

Parameters

callable $callback

数据操作方法回调

Returns

mixed —

startTrans()

startTrans() : void

启动事务

commit()

commit() : void

用于非自动提交状态下面的查询提交

Throws

\think\db\concern\PDOException

rollback()

rollback() : void

事务回滚

Throws

\think\db\concern\PDOException