Skip to content

Commit

Permalink
Merge pull request #828 from jakartaee/update-delete-int-disable
Browse files Browse the repository at this point in the history
Disable Return of Affected Records Count for Update and Delete Operations in NoSQL Databases
  • Loading branch information
otaviojava authored Aug 29, 2024
2 parents d824ba4 + e7d2baa commit 922d4e0
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2353,7 +2353,19 @@ public void testTrue() {
"This method also tests the addition, subtraction, and multiplication operators.")
public void testUpdateQueryWithoutWhereClause() {
// Ensure there is no data left over from other tests:
shared.removeAll();

try {
shared.removeAll();
} catch (UnsupportedOperationException x) {
if (type.isKeywordSupportAtOrBelow(DatabaseType.GRAPH) && TestProperty.delay.isSet()) {
// NoSQL databases with eventual consistency might not be capable
// of counting removed entities.
// Use alternative approach for ensuring no data is present:
boxes.deleteAll(boxes.findAll().toList());
} else {
throw x;
}
}

TestPropertyUtility.waitForEventualConsistency();

Expand Down Expand Up @@ -2396,7 +2408,19 @@ public void testUpdateQueryWithoutWhereClause() {
assertEquals(120, b3.height); // increased by factor of 2
}

assertEquals(3, shared.removeAll());
try {
var removeAllResult = shared.removeAll();
assertEquals(3, removeAllResult);
} catch (UnsupportedOperationException x) {
if (type.isKeywordSupportAtOrBelow(DatabaseType.GRAPH) && TestProperty.delay.isSet()) {
// NoSQL databases with eventual consistency might not be capable
// of counting removed entities.
// Use alternative approach for removing entities.
boxes.deleteAll(boxes.findAll().toList());
} else {
throw x;
}
}

TestPropertyUtility.waitForEventualConsistency();

Expand Down

0 comments on commit 922d4e0

Please sign in to comment.