mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Use savepoints for nested transactions
- XE에서 사용하던 savepoint 방식을 복원 - 트랜잭션 안에서 commit이 무시되더라도 해당 사실을 알리는 로그를 남기도록 함
This commit is contained in:
parent
76c6ef56f2
commit
b9cb5f429a
1 changed files with 15 additions and 0 deletions
|
|
@ -572,6 +572,10 @@ class DB
|
|||
Debug::addQuery($this->getQueryLog('START TRANSACTION', 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_handle->exec(sprintf('SAVEPOINT `%s%s%d`', $this->_prefix, 'savepoint', $this->_transaction_level));
|
||||
}
|
||||
$this->_transaction_level++;
|
||||
return $this->_transaction_level;
|
||||
}
|
||||
|
|
@ -600,6 +604,10 @@ class DB
|
|||
Debug::addQuery($this->getQueryLog('ROLLBACK', 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_handle->exec(sprintf('ROLLBACK TO SAVEPOINT `%s%s%d`', $this->_prefix, 'savepoint', $this->_transaction_level - 1));
|
||||
}
|
||||
$this->_transaction_level--;
|
||||
return $this->_transaction_level;
|
||||
}
|
||||
|
|
@ -628,6 +636,13 @@ class DB
|
|||
Debug::addQuery($this->getQueryLog('COMMIT', 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Debug::isEnabledForCurrentUser())
|
||||
{
|
||||
Debug::addQuery($this->getQueryLog('NESTED COMMIT IGNORED BY RHYMIX', 0));
|
||||
}
|
||||
}
|
||||
$this->_transaction_level--;
|
||||
return $this->_transaction_level;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue