diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java index 30ee3d0..e1b1d18 100755 --- a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java +++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java @@ -332,12 +332,6 @@ public class RDBDocumentStore implements DocumentStore { // bulk update requires two DB requests, so if we have <= 2 operations // it's better to send them sequentially while (operationsToCover.size() > 2) { - // We should try to insert documents only during the first - // iteration. In the 2nd and 3rd iterations we only deal with - // conflicting documents, so they already exist in the database - // and there's no point in inserting them. - boolean upsert = i == 0; - if (i++ == 3) { // operations that conflicted in 3 consecutive bulk // updates should be applied sequentially @@ -345,7 +339,7 @@ public class RDBDocumentStore implements DocumentStore { } for (List partition : partition(newArrayList(operationsToCover.values()), CHUNKSIZE)) { - Map successfulUpdates = bulkUpdate(collection, partition, oldDocs, upsert); + Map successfulUpdates = bulkUpdate(collection, partition, oldDocs, true); results.putAll(successfulUpdates); operationsToCover.values().removeAll(successfulUpdates.keySet()); }