mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 14:22:54 +09:00
Close Connection when there is no connection value.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13161 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
034a5c0288
commit
f70ce644ce
1410 changed files with 7188 additions and 53541 deletions
|
|
@ -158,6 +158,12 @@ class DB
|
|||
*/
|
||||
var $use_prepared_statements;
|
||||
|
||||
/**
|
||||
* leve of transaction
|
||||
* @var unknown
|
||||
*/
|
||||
private $transationNestedLevel = 0;
|
||||
|
||||
/**
|
||||
* returns instance of certain db type
|
||||
* @param string $db_type type of db
|
||||
|
|
@ -1160,14 +1166,15 @@ class DB
|
|||
*/
|
||||
function begin()
|
||||
{
|
||||
if(!$this->isConnected() || $this->transaction_started)
|
||||
if(!$this->isConnected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->_begin())
|
||||
if($this->_begin($this->transationNestedLevel))
|
||||
{
|
||||
$this->transaction_started = TRUE;
|
||||
$this->transationNestedLevel++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1191,9 +1198,14 @@ class DB
|
|||
{
|
||||
return;
|
||||
}
|
||||
if($this->_rollback())
|
||||
if($this->_rollback($this->transationNestedLevel))
|
||||
{
|
||||
$this->transaction_started = FALSE;
|
||||
$this->transationNestedLevel--;
|
||||
|
||||
if(!$this->transationNestedLevel)
|
||||
{
|
||||
$this->transaction_started = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1218,9 +1230,14 @@ class DB
|
|||
{
|
||||
return;
|
||||
}
|
||||
if($this->_commit())
|
||||
if($this->transationNestedLevel == 1 && $this->_commit())
|
||||
{
|
||||
$this->transaction_started = FALSE;
|
||||
$this->transationNestedLevel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->transationNestedLevel--;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue