@@ -530,11 +530,11 @@ public function getNamespaces()
530
530
*
531
531
* @param $query
532
532
* @param array $params
533
- * @param array $types
534
533
* @throws DBALException
535
534
*/
536
- private function executeUpdate ($ query , array $ params = array (), array $ types = array () )
535
+ private function executeChunkedUpdate ($ query , array $ params )
537
536
{
537
+ $ types = array (Connection::PARAM_INT_ARRAY );
538
538
if ($ this ->conn ->getDatabasePlatform () instanceof SqlitePlatform) {
539
539
foreach (array_chunk ($ params , 999 ) as $ chunk ) {
540
540
$ this ->conn ->executeUpdate ($ query , array ($ chunk ), $ types );
@@ -748,7 +748,7 @@ private function syncReferences()
748
748
try {
749
749
foreach ($ this ->referenceTables as $ table ) {
750
750
$ query = "DELETE FROM $ table WHERE source_id IN (?) " ;
751
- $ this ->executeUpdate ($ query , array ( array_keys ($ toUpdate)), array (Connection:: PARAM_INT_ARRAY ));
751
+ $ this ->executeChunkedUpdate ($ query , array_keys ($ toUpdate ));
752
752
}
753
753
} catch (DBALException $ e ) {
754
754
throw new RepositoryException ('Unexpected exception while cleaning up after saving ' , $ e ->getCode (), $ e );
@@ -784,7 +784,7 @@ private function syncReferences()
784
784
// remove all PropertyType::REFERENCE with a source_id on a deleted node
785
785
try {
786
786
$ query = "DELETE FROM phpcr_nodes_references WHERE source_id IN (?) " ;
787
- $ this ->executeUpdate ($ query , array ( $ params), array (Connection:: PARAM_INT_ARRAY ) );
787
+ $ this ->executeChunkedUpdate ($ query , $ params );
788
788
} catch (DBALException $ e ) {
789
789
throw new RepositoryException ('Unexpected exception while cleaning up deleted nodes ' , $ e ->getCode (), $ e );
790
790
}
@@ -823,7 +823,7 @@ private function syncReferences()
823
823
try {
824
824
foreach ($ this ->referenceTables as $ table ) {
825
825
$ query = "DELETE FROM $ table WHERE target_id IN (?) " ;
826
- $ this ->executeUpdate ($ query , array ( $ params), array (Connection:: PARAM_INT_ARRAY ) );
826
+ $ this ->executeChunkedUpdate ($ query , $ params );
827
827
}
828
828
} catch (DBALException $ e ) {
829
829
throw new RepositoryException ('Unexpected exception while cleaning up deleted nodes ' , $ e ->getCode (), $ e );
0 commit comments