diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphTransaction.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphTransaction.java index e81d7946b5..33124e831f 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphTransaction.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphTransaction.java @@ -1411,7 +1411,7 @@ private void traverseByLabel(SchemaLabel label, * Query.DEFAULT_CAPACITY to limit elements number per pass */ query.limit(Query.DEFAULT_CAPACITY); - query.capacity(Query.DEFAULT_CAPACITY); + query.capacity(Query.NO_CAPACITY); query.eq(HugeKeys.LABEL, label.id()); int pass = 0; int counter = 0; diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/IndexableTransaction.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/IndexableTransaction.java index 39514e99ff..180d9471f4 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/IndexableTransaction.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/IndexableTransaction.java @@ -57,6 +57,15 @@ protected void commit2Backend() { this.commitMutation2Backend(mutation, txMutation); } + @Override + public void commitIfGtSize(int size) throws BackendException { + int totalSize = this.mutationSize() + + this.indexTransaction().mutationSize(); + if (totalSize >= size) { + this.commit(); + } + } + @Override public void rollback() throws BackendException { try {