Skip to content

Commit

Permalink
codestyle and php 5.3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
derflocki committed Mar 29, 2016
1 parent e474423 commit f50e3a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/Adapter/Statement/Oracle.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function bindParam($column, &$variable, $type = null, $length = null, $dr
public function closeCursor()
{
$this->bindParams = array();
if(is_resource($this->statement)) {
if (is_resource($this->statement)) {
return oci_free_statement($this->statement);
}
return true;
Expand Down
19 changes: 9 additions & 10 deletions lib/Doctrine/Connection/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ public function __construct(Doctrine_Connection $conn, $stmt)
*
* make sure that the cursor is closed
*
* */
public function __destruct() {
*/
public function __destruct()
{
$this->closeCursor();
}
/**
Expand Down Expand Up @@ -269,19 +270,17 @@ public function execute($params = null)

$this->_conn->getListener()->postStmtExecute($event);

} catch (PDOException $e) {
$result = false;
$this->_conn->rethrowException($e, $this);
} catch (Doctrine_Adapter_Exception $e) {
$result = false;
$this->_conn->rethrowException($e, $this);
} finally {
//fix a possible "ORA-01000: maximum open cursors exceeded" when many non-SELECTs are executed
//fix a possible "ORA-01000: maximum open cursors exceeded" when many non-SELECTs are executed and the profiling is enabled
if (strtoupper(substr($this->_stmt->queryString,0,6)) != 'SELECT' && strtoupper(substr($this->_stmt->queryString,0,4)) != 'WITH' ){
$this->closeCursor();
}
return $result;
} catch (PDOException $e) {
} catch (Doctrine_Adapter_Exception $e) {
}

$this->_conn->rethrowException($e, $this);

return false;
}

Expand Down

0 comments on commit f50e3a3

Please sign in to comment.