Skip to content

Commit

Permalink
fixed previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed May 2, 2015
1 parent f043906 commit d5eb6d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Jackalope/Transport/DoctrineDBAL/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,11 @@ public function getNamespaces()
*
* @param $query
* @param array $params
* @param array $types
* @throws DBALException
*/
private function executeUpdate($query, array $params = array(), array $types = array())
private function executeChunkedUpdate($query, array $params)
{
$types = array(Connection::PARAM_INT_ARRAY);
if ($this->conn->getDatabasePlatform() instanceof SqlitePlatform) {
foreach (array_chunk($params, 999) as $chunk) {
$this->conn->executeUpdate($query, array($chunk), $types);
Expand Down Expand Up @@ -748,7 +748,7 @@ private function syncReferences()
try {
foreach ($this->referenceTables as $table) {
$query = "DELETE FROM $table WHERE source_id IN (?)";
$this->executeUpdate($query, array(array_keys($toUpdate)), array(Connection::PARAM_INT_ARRAY));
$this->executeChunkedUpdate($query, array_keys($toUpdate));
}
} catch (DBALException $e) {
throw new RepositoryException('Unexpected exception while cleaning up after saving', $e->getCode(), $e);
Expand Down Expand Up @@ -784,7 +784,7 @@ private function syncReferences()
// remove all PropertyType::REFERENCE with a source_id on a deleted node
try {
$query = "DELETE FROM phpcr_nodes_references WHERE source_id IN (?)";
$this->executeUpdate($query, array($params), array(Connection::PARAM_INT_ARRAY));
$this->executeChunkedUpdate($query, $params);
} catch (DBALException $e) {
throw new RepositoryException('Unexpected exception while cleaning up deleted nodes', $e->getCode(), $e);
}
Expand Down Expand Up @@ -823,7 +823,7 @@ private function syncReferences()
try {
foreach ($this->referenceTables as $table) {
$query = "DELETE FROM $table WHERE target_id IN (?)";
$this->executeUpdate($query, array($params), array(Connection::PARAM_INT_ARRAY));
$this->executeChunkedUpdate($query, $params);
}
} catch (DBALException $e) {
throw new RepositoryException('Unexpected exception while cleaning up deleted nodes', $e->getCode(), $e);
Expand Down

0 comments on commit d5eb6d6

Please sign in to comment.