- Patch #669794 by andypost, Josh Waihi, aspilicious, moshe weitzman, catch: use savepoints for nested transactions.

merge-requests/26/head
Dries Buytaert 2010-04-06 16:54:15 +00:00
parent 1201676f3d
commit 36088732bb
2 changed files with 16 additions and 3 deletions

View File

@ -896,6 +896,14 @@ abstract class DatabaseConnection extends PDO {
if ($this->supportsTransactions()) {
parent::rollBack();
}
else {
// Log unsupported rollback.
$this->rollbackLogs[] = array(
'type' => 'database',
'message' => t('Explicit rollback failed: not supported on active connection.'),
'variables' => array(),
);
}
$this->logRollback();
}
@ -911,9 +919,6 @@ abstract class DatabaseConnection extends PDO {
$logging_callback = $logging['callback'];
// Log the failed rollback.
call_user_func($logging_callback, 'database', 'Explicit rollback failed: not supported on active connection.', array(), $logging['error_severity']);
// Play back the logged errors to the specified logging callback post-
// rollback.
foreach ($this->rollbackLogs as $log_item) {

View File

@ -265,6 +265,14 @@ class DatabaseConnection_sqlite extends DatabaseConnection {
if ($this->supportsTransactions()) {
PDO::rollBack();
}
else {
// Log unsupported rollback.
$this->rollbackLogs[] = array(
'type' => 'database',
'message' => t('Explicit rollback failed: not supported on active connection.'),
'variables' => array(),
);
}
$this->logRollback();
}