mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 19:42:15 +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
|
|
@ -51,10 +51,18 @@ class DBMysql_innodb extends DBMysql
|
|||
* this method is private
|
||||
* @return boolean
|
||||
*/
|
||||
function _begin()
|
||||
function _begin($transactionLevel)
|
||||
{
|
||||
$connection = $this->_getConnection('master');
|
||||
$this->_query("begin", $connection);
|
||||
|
||||
if(!$transactionLevel)
|
||||
{
|
||||
$this->_query("START TRANSACTION", $connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_query("SAVEPOINT SP" . $transactionLevel, $connection);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -63,10 +71,20 @@ class DBMysql_innodb extends DBMysql
|
|||
* this method is private
|
||||
* @return boolean
|
||||
*/
|
||||
function _rollback()
|
||||
function _rollback($transactionLevel)
|
||||
{
|
||||
$connection = $this->_getConnection('master');
|
||||
$this->_query("rollback", $connection);
|
||||
|
||||
$point = $transactionLevel - 1;
|
||||
|
||||
if($point)
|
||||
{
|
||||
$this->_query("ROLLBACK TO SP" . $point, $connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_query("ROLLBACK", $connection);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -91,6 +109,11 @@ class DBMysql_innodb extends DBMysql
|
|||
*/
|
||||
function __query($query, $connection)
|
||||
{
|
||||
if(!$connection)
|
||||
{
|
||||
Context::close();
|
||||
exit();
|
||||
}
|
||||
// Run the query statement
|
||||
$result = @mysql_query($query, $connection);
|
||||
// Error Check
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue