Final Class Yiisoft\Db\Mssql\Transaction
| Inheritance | Yiisoft\Db\Mssql\Transaction » Yiisoft\Db\Driver\Pdo\AbstractPdoTransaction |
|---|
Implements the MSSQL Server specific transaction.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| createSavepoint() | Creates a new savepoint. | Yiisoft\Db\Mssql\Transaction |
| releaseSavepoint() | Releases an existing savepoint. | Yiisoft\Db\Mssql\Transaction |
| rollBackSavepoint() | Rolls back to a before created savepoint. | Yiisoft\Db\Mssql\Transaction |
Method Details
Creates a new savepoint.
| public void createSavepoint ( string $name ) | ||
| $name | string |
The savepoint name. |
| throws | \Yiisoft\Db\Exception\Exception|\Yiisoft\Db\Exception\InvalidConfigException|Throwable | |
|---|---|---|
public function createSavepoint(string $name): void
{
$this->db->createCommand("SAVE TRANSACTION $name")->execute();
}
Releases an existing savepoint.
| public void releaseSavepoint ( string $name ) | ||
| $name | string |
The savepoint name. |
public function releaseSavepoint(string $name): void
{
// does nothing as MSSQL doesn't support this
}
Rolls back to a before created savepoint.
| public void rollBackSavepoint ( string $name ) | ||
| $name | string |
The savepoint name. |
| throws | \Yiisoft\Db\Exception\Exception|\Yiisoft\Db\Exception\InvalidConfigException|Throwable | |
|---|---|---|
public function rollBackSavepoint(string $name): void
{
$this->db->createCommand("ROLLBACK TRANSACTION $name")->execute();
}
Signup or Login in order to comment.