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:
misol 2013-09-25 15:29:32 +00:00
parent 034a5c0288
commit f70ce644ce
1410 changed files with 7188 additions and 53541 deletions

View file

@ -157,12 +157,20 @@ class DBCubrid extends DB
* this method is private
* @return boolean
*/
function _begin()
function _begin($transactionLevel)
{
if(__CUBRID_VERSION__ >= '8.4.0')
{
$connection = $this->_getConnection('master');
cubrid_set_autocommit($connection, CUBRID_AUTOCOMMIT_FALSE);
if(!$transactionLevel)
{
cubrid_set_autocommit($connection, CUBRID_AUTOCOMMIT_FALSE);
}
else
{
$this->_query("SAVEPOINT SP" . $transactionLevel, $connection);
}
}
return TRUE;
}
@ -172,10 +180,21 @@ class DBCubrid extends DB
* this method is private
* @return boolean
*/
function _rollback()
function _rollback($transactionLevel)
{
$connection = $this->_getConnection('master');
@cubrid_rollback($connection);
$point = $transactionLevel - 1;
if($point)
{
$this->_query("ROLLBACK TO SP" . $point, $connection);
}
else
{
@cubrid_rollback($connection);
}
return TRUE;
}
@ -858,6 +877,7 @@ class DBCubrid extends DB
$query = $this->getInsertSql($queryObject, $with_values);
if(is_a($query, 'Object'))
{
unset($this->param);
return;
}
@ -888,6 +908,7 @@ class DBCubrid extends DB
$query = $this->getUpdateSql($queryObject, $with_values);
if(is_a($query, 'Object'))
{
unset($this->param);
return;
}
@ -919,6 +940,7 @@ class DBCubrid extends DB
$query = $this->getDeleteSql($queryObject, $with_values);
if(is_a($query, 'Object'))
{
unset($this->param);
return;
}
@ -961,6 +983,7 @@ class DBCubrid extends DB
$query = $this->getSelectSql($queryObject, $with_values);
if(is_a($query, 'Object'))
{
unset($this->param);
return;
}
@ -969,6 +992,7 @@ class DBCubrid extends DB
if($this->isError())
{
unset($this->param);
return $this->queryError($queryObject);
}
@ -1049,7 +1073,7 @@ class DBCubrid extends DB
$page_count = 10;
}
$page = $limit->page->getValue();
if(!$page)
if(!$page || $page < 1)
{
$page = 1;
}
@ -1075,6 +1099,7 @@ class DBCubrid extends DB
$buff->page = $page;
$buff->data = array();
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
unset($this->param);
return $buff;
}
$start_count = ($page - 1) * $list_count;
@ -1084,6 +1109,7 @@ class DBCubrid extends DB
$result = $this->_query($query, $connection);
if($this->isError())
{
unset($this->param);
return $this->queryError($queryObject);
}