Proposal (Changes for Zend_Db_Adapter_Oracle:
/**
- @var integer
*/
protected $_defaultExecuteMode = OCI_COMMIT_ON_SUCCESS;
/**
- @param integer $mode
- @throws Zend_Db_Adapter_Oracle_Exception
*/
public function setDefaultExecuteMode($mode) {
$this->_defaultExecuteMode = $mode;
}
/**
- Creates a connection resource.
*
- @return void
- @throws Zend_Db_Adapter_Oracle_Exception
*/
protected function _connect()
{
if (is_resource($this->_connection)) {
// connection already exists
return;
}
if (!extension_loaded('oci8')) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
require_once 'Zend/Db/Adapter/Oracle/Exception.php';
throw new Zend_Db_Adapter_Oracle_Exception('The OCI8 extension is required for this adapter but the extension is not loaded');
}
// When not explicitly set, use default execution mode
if (!$this->_execute_mode) {
$this->_setExecuteMode($this->_defaultExecuteMode);
}
$connectionFuncName = ($this->_config['persistent'] == true) ? 'oci_pconnect' : 'oci_connect';
$this->_connection = @$connectionFuncName(
$this->_config['username'],
$this->_config['password'],
$this->_config['dbname'],
$this->_config['charset']);
// check the connection
if (!$this->_connection) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
require_once 'Zend/Db/Adapter/Oracle/Exception.php';
throw new Zend_Db_Adapter_Oracle_Exception(oci_error());
}
}
/**
- Commit a transaction and return to default execution mode.
*
- @return void
- @throws Zend_Db_Adapter_Oracle_Exception
*/
protected function _commit()
Unknown macro: { if (!oci_commit($this->_connection)) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
require_once 'Zend/Db/Adapter/Oracle/Exception.php';
throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection));
}
$this->_setExecuteMode($this->_defaultExecuteMode);
}
/**
* Roll back a transaction and return to default execution mode.
*
* @return void
* @throws Zend_Db_Adapter_Oracle_Exception
*/
protected function _rollBack()
{
if (!oci_rollback($this->_connection)) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
require_once 'Zend/Db/Adapter/Oracle/Exception.php';
throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection));
} }
$this->_setExecuteMode($this->_defaultExecuteMode);
}
Proposal (Changes for Zend_Db_Adapter_Oracle:
/**
*/
protected $_defaultExecuteMode = OCI_COMMIT_ON_SUCCESS;
/**
*/
public function setDefaultExecuteMode($mode) { $this->_defaultExecuteMode = $mode; }
/**
*
*/
protected function _connect()
{
if (is_resource($this->_connection)) { // connection already exists return; }
if (!extension_loaded('oci8')) { /** * @see Zend_Db_Adapter_Oracle_Exception */ require_once 'Zend/Db/Adapter/Oracle/Exception.php'; throw new Zend_Db_Adapter_Oracle_Exception('The OCI8 extension is required for this adapter but the extension is not loaded'); }
// When not explicitly set, use default execution mode
if (!$this->_execute_mode) { $this->_setExecuteMode($this->_defaultExecuteMode); }
$connectionFuncName = ($this->_config['persistent'] == true) ? 'oci_pconnect' : 'oci_connect';
$this->_connection = @$connectionFuncName(
$this->_config['username'],
$this->_config['password'],
$this->_config['dbname'],
$this->_config['charset']);
// check the connection
if (!$this->_connection) { /** * @see Zend_Db_Adapter_Oracle_Exception */ require_once 'Zend/Db/Adapter/Oracle/Exception.php'; throw new Zend_Db_Adapter_Oracle_Exception(oci_error()); }
}
/**
*
*/
protected function _commit()
$this->_setExecuteMode($this->_defaultExecuteMode);
}
/**
* Roll back a transaction and return to default execution mode.
*
* @return void
* @throws Zend_Db_Adapter_Oracle_Exception
*/
protected function _rollBack()
{
if (!oci_rollback($this->_connection)) { /** * @see Zend_Db_Adapter_Oracle_Exception */ require_once 'Zend/Db/Adapter/Oracle/Exception.php'; throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection)); } }
$this->_setExecuteMode($this->_defaultExecuteMode);
}
- @var integer
*/
protected $_defaultExecuteMode = OCI_COMMIT_ON_SUCCESS;
/**- @param integer $mode
- @throws Zend_Db_Adapter_Oracle_Exception
*/
public function setDefaultExecuteMode($mode) {
$this->_defaultExecuteMode = $mode;
}
/**
- Creates a connection resource.
*
- @return void
- @throws Zend_Db_Adapter_Oracle_Exception
*/
protected function _connect()
{
if (is_resource($this->_connection)) {
// connection already exists
return;
}
if (!extension_loaded('oci8')) { /** * @see Zend_Db_Adapter_Oracle_Exception */ require_once 'Zend/Db/Adapter/Oracle/Exception.php'; throw new Zend_Db_Adapter_Oracle_Exception('The OCI8 extension is required for this adapter but the extension is not loaded'); } // When not explicitly set, use default execution mode if (!$this->_execute_mode) { $this->_setExecuteMode($this->_defaultExecuteMode); } $connectionFuncName = ($this->_config['persistent'] == true) ? 'oci_pconnect' : 'oci_connect'; $this->_connection = @$connectionFuncName( $this->_config['username'], $this->_config['password'], $this->_config['dbname'], $this->_config['charset']); // check the connection if (!$this->_connection) { /** * @see Zend_Db_Adapter_Oracle_Exception */ require_once 'Zend/Db/Adapter/Oracle/Exception.php'; throw new Zend_Db_Adapter_Oracle_Exception(oci_error()); } } /**