Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

fixed 'ORA-01000: maximum open cursors exceeded' for batch tasks #46

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/Doctrine/Connection/Statement.php
Expand Up @@ -260,14 +260,22 @@ public function execute($params = null)
}

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

//fdorn, pguthy: 2011-07-04: fix maximum cursors exceeded with data-load
//Sometimes Selects appear here. SO close the startements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is wrong.

if (substr($this->_stmt->queryString,0,6) != 'SELECT'){
$this->_stmt->closeCursor();
}
return $result;
} catch (PDOException $e) {
} catch (Doctrine_Adapter_Exception $e) {
}

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

if (substr($this->_stmt->queryString,0,6) != 'SELECT'){
$this->_stmt->closeCursor();
}

return false;
}

Expand Down
9 changes: 7 additions & 2 deletions lib/Doctrine/Hydrator/Graph.php
Expand Up @@ -105,13 +105,16 @@ public function hydrateResultSet($stmt)
} else {
$data = $stmt->fetch(Doctrine_Core::FETCH_ASSOC);
if ( ! $data) {
$stmt->closeCursor();
$this->flush();
return $result;
}
}
$activeRootIdentifier = null;
} else {
$data = $stmt->fetch(Doctrine_Core::FETCH_ASSOC);
if ( ! $data) {
if ( ! $data) {
$stmt->closeCursor();
return $result;
}
}
Expand All @@ -134,6 +137,8 @@ public function hydrateResultSet($stmt)
} else if ($activeRootIdentifier != $id[$rootAlias]) {
// first row for the next record
$this->_priorRow = $data;
$this->closeCursor();
$this->flush();
return $result;
}
}
Expand Down Expand Up @@ -434,4 +439,4 @@ protected function _getClassnameToReturn(array &$data, $component)

return $matchedComponent;
}
}
}