Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ibase: transactions bugfix

git-svn-id: svn://dklab.ru/lib/DbSimple/trunk@221 78bb956b-1e24-0410-b8d0-c528fdc9eae3
  • Loading branch information...
commit 1e4160caf9b2249b80bc2c5a5c78233a3fbd7af6 1 parent 27f6394
dk authored
Showing with 12 additions and 4 deletions.
  1. +12 −4 lib/DbSimple/Ibase.php
View
16 lib/DbSimple/Ibase.php
@@ -106,14 +106,22 @@ function _performGetPlaceholderIgnoreRe()
function _performCommit()
{
if (!is_resource($this->trans)) return false;
- return @ibase_commit($this->trans);
+ $result = @ibase_commit($this->trans);
+ if (true === $result) {
+ $this->trans = null;
+ }
+ return $result;
}
function _performRollback()
{
if (!is_resource($this->trans)) return false;
- return @ibase_rollback($this->trans);
+ $result = @ibase_rollback($this->trans);
+ if (true === $result) {
+ $this->trans = null;
+ }
+ return $result;
}
function _performTransformQuery(&$queryMain, $how)
@@ -158,7 +166,7 @@ function _performQuery($queryMain)
$hash = $queryMain[0];
if (!isset($this->prepareCache[$hash])) {
- $this->prepareCache[$hash] = @ibase_prepare($this->link, $queryMain[0]);
+ $this->prepareCache[$hash] = @ibase_prepare((is_resource($this->trans) ? $this->trans : $this->link), $queryMain[0]);
} else {
// Prepare cache hit!
}
@@ -177,7 +185,7 @@ function _performQuery($queryMain)
if ($result === false) return $this->_setDbError($queryMain[0]);
if (!is_resource($result)) {
// Non-SELECT queries return number of affected rows, SELECT - resource.
- return @ibase_affected_rows($this->link);
+ return @ibase_affected_rows((is_resource($this->trans) ? $this->trans : $this->link));
}
return $result;
}
Please sign in to comment.
Something went wrong with that request. Please try again.