stefan-egli commented on code in PR #863:
URL: https://github.com/apache/jackrabbit-oak/pull/863#discussion_r1177851164


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java:
##########
@@ -1470,6 +1487,18 @@ public <T extends Document> boolean create(Collection<T> 
collection, List<Update
                 }
                 insertSuccess = true;
                 return true;
+            } catch (BsonMaximumSizeExceededException e) {
+                T doct = null;
+                for (T doc : docs) {
+                    doct = doc;
+                    // doc.getMemory()/2 - converting from UTF-16 to UTF-8
+                    if (doc.getMemory()/2 > SIZE_LIMIT) {
+                        LOG.error("Failed to create the document with Id={} 
has size={}" +
+                                        " with 
BsonMaximumSizeExceededException message '{}",
+                                doc.getId(), doc.getMemory()/2, 
e.getMessage());
+                    }
+                }
+                throw handleException(e, collection, doct.getId());

Review Comment:
   +1, I was not looking at the whole context. return `false` is correct



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to