ZF-11113: Zend_Db_Statement_Oracle::_prepare() throws PHP-Warnings
Description
After connecting to an Oracle-DB PHP looses the connection because of an error on the DB-Server. The crash of oracle is not the problem, but the behaviour of our php-application: the Function Zend_Db_Statement_Oracle::_prepare() failed with an PHP-Warning ('oci_parse(): ORA-03114: not connected to ORACLE'). The coded exception was not thrown.
protected function _prepare($sql)
{
$connection = $this->_adapter->getConnection();
$this->_stmt = oci_parse($connection, $sql);
if (!$this->_stmt) {
/**
* @see Zend_Db_Statement_Oracle_Exception
*/
require_once 'Zend/Db/Statement/Oracle/Exception.php';
throw new Zend_Db_Statement_Oracle_Exception(oci_error($connection));
}
}
I think the "oci_parse($connection, $sql);" needed a leading "@", so the exception can be thrown. Functions like "_bindParam" are realised with a "@".
Comments
Posted by Adam Lundrigan (adamlundrigan) on 2011-05-01T03:12:50.000+0000
Fixed in trunk r23917
Posted by Satoru Yoshida (satoruyoshida) on 2011-05-03T10:46:23.000+0000
Hello, Adam. I will push [solve] button as proxy for You. If You want to release at next mini, You can merge this commit fron trunk to 1.11 branch.
Thanks.
Posted by Ralph Schindler (ralph) on 2011-05-03T14:19:44.000+0000
Not merged yet, will do shortly.
Posted by Satoru Yoshida (satoruyoshida) on 2011-05-03T15:09:52.000+0000
Hi, Ralph . I merged this from trunk to 1.11 branch at r23959.