Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,11 @@ public <V> void addVertexProperty(HugeVertexProperty<V> prop) {
vertex.setProperty(prop);
return;
}
boolean vertexPropertyUpdatable = this.store().features()
.supportsUpdateVertexProperty();
// Check is updating property of added/removed vertex
E.checkArgument(!this.addedVertexes.containsKey(vertex.id()) ||
E.checkArgument(!vertexPropertyUpdatable ||
!this.addedVertexes.containsKey(vertex.id()) ||
this.updatedVertexes.containsKey(vertex.id()),
"Can't update property '%s' for adding-state vertex",
prop.key());
Expand All @@ -643,7 +646,7 @@ public <V> void addVertexProperty(HugeVertexProperty<V> prop) {
this.propertyUpdated(vertex, vertex.setProperty(prop));
this.indexTx.updateVertexIndex(vertex, false);

if (this.store().features().supportsUpdateVertexProperty()) {
if (vertexPropertyUpdatable) {
// Append new property(OUT and IN owner edge)
this.doAppend(this.serializer.writeVertexProperty(prop));
} else {
Expand Down Expand Up @@ -675,8 +678,11 @@ public <V> void removeVertexProperty(HugeVertexProperty<V> prop) {
vertex.removeProperty(propKey.id());
return;
}
boolean vertexPropertyUpdatable = this.store().features()
.supportsUpdateVertexProperty();
// Check is updating property of added/removed vertex
E.checkArgument(!this.addedVertexes.containsKey(vertex.id()),
E.checkArgument(!vertexPropertyUpdatable ||
!this.addedVertexes.containsKey(vertex.id()),
"Can't remove property '%s' for adding-state vertex",
prop.key());
E.checkArgument(!this.removedVertexes.containsKey(vertex.id()),
Expand All @@ -693,7 +699,7 @@ public <V> void removeVertexProperty(HugeVertexProperty<V> prop) {
this.propertyUpdated(vertex, vertex.removeProperty(propKey.id()));
this.indexTx.updateVertexIndex(vertex, false);

if (this.store().features().supportsUpdateVertexProperty()) {
if (vertexPropertyUpdatable) {
// Eliminate the property(OUT and IN owner edge)
this.doEliminate(this.serializer.writeVertexProperty(prop));
} else {
Expand All @@ -717,8 +723,11 @@ public <V> void addEdgeProperty(HugeEdgeProperty<V> prop) {
edge.setProperty(prop);
return;
}
boolean edgePropertyUpdatable = this.store().features()
.supportsUpdateEdgeProperty();
// Check is updating property of added/removed edge
E.checkArgument(!this.addedEdges.containsKey(edge.id()) ||
E.checkArgument(!edgePropertyUpdatable ||
!this.addedEdges.containsKey(edge.id()) ||
this.updatedEdges.containsKey(edge.id()),
"Can't update property '%s' for adding-state edge",
prop.key());
Expand All @@ -741,7 +750,7 @@ public <V> void addEdgeProperty(HugeEdgeProperty<V> prop) {
this.propertyUpdated(edge, edge.setProperty(prop));
this.indexTx.updateEdgeIndex(edge, false);

if (this.store().features().supportsUpdateEdgeProperty()) {
if (edgePropertyUpdatable) {
// Append new property(OUT and IN owner edge)
this.doAppend(this.serializer.writeEdgeProperty(prop));
this.doAppend(this.serializer.writeEdgeProperty(
Expand Down Expand Up @@ -774,8 +783,11 @@ public <V> void removeEdgeProperty(HugeEdgeProperty<V> prop) {
edge.removeProperty(propKey.id());
return;
}
boolean edgePropertyUpdatable = this.store().features()
.supportsUpdateEdgeProperty();
// Check is updating property of added/removed edge
E.checkArgument(!this.addedEdges.containsKey(edge.id()) ||
E.checkArgument(!edgePropertyUpdatable ||
!this.addedEdges.containsKey(edge.id()) ||
this.updatedEdges.containsKey(edge.id()),
"Can't remove property '%s' for adding-state edge",
prop.key());
Expand All @@ -793,7 +805,7 @@ public <V> void removeEdgeProperty(HugeEdgeProperty<V> prop) {
this.propertyUpdated(edge, edge.removeProperty(propKey.id()));
this.indexTx.updateEdgeIndex(edge, false);

if (this.store().features().supportsUpdateEdgeProperty()) {
if (edgePropertyUpdatable) {
// Eliminate the property(OUT and IN owner edge)
this.doEliminate(this.serializer.writeEdgeProperty(prop));
this.doEliminate(this.serializer.writeEdgeProperty(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public Integer commit() {
updated += IntStream.of(statement.executeBatch()).sum();
}
this.conn.commit();
this.conn.setAutoCommit(true);
this.clear();
} catch (SQLException e) {
throw new BackendException("Failed to commit", e);
Expand Down
3 changes: 3 additions & 0 deletions hugegraph-test/src/main/resources/fast-methods.filter
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ org.apache.tinkerpop.gremlin.structure.TransactionTest.shouldExecuteWithCompetin

#################### process suite ####################

# multiple source vertices VertexStep with range
org.apache.tinkerpop.gremlin.process.traversal.step.filter.RangeTest.Traversals.g_V_repeatXbothX_timesX3X_rangeX5_11X: Range applied to last VertexStep as offset and limit for each Query, rather than result sets

# unsupported automatic edge id, therefore number of edge is wrong
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest.shouldTriggerAddEdge: Unsupported automatic edge id, therefore number of edge is wrong
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest.shouldTriggerAddEdgeByPath: Unsupported automatic edge id, therefore number of edge is wrong
Expand Down
3 changes: 3 additions & 0 deletions hugegraph-test/src/main/resources/methods.filter
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ org.apache.tinkerpop.gremlin.structure.TransactionTest.shouldExecuteWithCompetin

#################### process suite ####################

# multiple source vertices VertexStep with range
org.apache.tinkerpop.gremlin.process.traversal.step.filter.RangeTest.Traversals.g_V_repeatXbothX_timesX3X_rangeX5_11X: Range applied to last VertexStep as offset and limit for each Query, rather than result sets

# unsupported automatic edge id, therefore number of edge is wrong
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest.shouldTriggerAddEdge: Unsupported automatic edge id, therefore number of edge is wrong
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest.shouldTriggerAddEdgeByPath: Unsupported automatic edge id, therefore number of edge is wrong
Expand Down