- added methods for transaction handling

This commit is contained in:
steinm 2012-12-14 14:35:09 +00:00
parent 7470186a05
commit e6916f98d3

View File

@ -194,6 +194,27 @@ class LetoDMS_Core_DatabaseAccess {
return $res;
} /* }}} */
function startTransaction() { /* {{{ */
if(!$this->_intransaction) {
$this->_conn->beginTransaction();
}
$this->_intransaction++;
} /* }}} */
function rollbackTransaction() { /* {{{ */
if($this->_intransaction == 1) {
$this->_conn->rollBack();
}
$this->_intransaction--;
} /* }}} */
function commitTransaction() { /* {{{ */
if($this->_intransaction == 1) {
$this->_conn->commit();
}
$this->_intransaction--;
} /* }}} */
/**
* Return the id of the last instert record
*