Rollback for insertion of null keys for sbtree v1 is implemented.
@@ -702,9 +702,32 @@ public class SBTreeV1TestIT {
nullSBTree.create(OIntegerSerializer.INSTANCE, OLinkSerializer.INSTANCE, null, 1, true, null);
try {
- for (int i = 0; i < 10; i++)
+ for (int i = 0; i < 10; i++) {
nullSBTree.put(i, new ORecordId(3, i));
+ }
+
+ final OAtomicOperationsManager atomicOperationsManager = storage.getAtomicOperationsManager();
+ atomicOperationsManager.startAtomicOperation((String) null, false);
+ doNullTesting(nullSBTree);
+ atomicOperationsManager.endAtomicOperation(true);
+
+ doNullTesting(nullSBTree);
+
+ } finally {
+ final OSBTree.OSBTreeKeyCursor<Integer> keyCursor = nullSBTree.keyCursor();
+
+ Integer key = keyCursor.next(-1);
+ while (key != null) {
+ nullSBTree.remove(key);
+ key = keyCursor.next(-1);
+ }
+
+ nullSBTree.remove(null);
+ nullSBTree.delete();
+ }
+ }
+ private void doNullTesting(OSBTreeV1<Integer, OIdentifiable> nullSBTree) throws java.io.IOException {
OIdentifiable identifiable = nullSBTree.get(null);
Assert.assertNull(identifiable);
@@ -724,18 +747,6 @@ public class SBTreeV1TestIT {
identifiable = nullSBTree.get(null);
Assert.assertNull(identifiable);
- } finally {
- final OSBTree.OSBTreeKeyCursor<Integer> keyCursor = nullSBTree.keyCursor();
-
- Integer key = keyCursor.next(-1);
- while (key != null) {
- nullSBTree.remove(key);
- key = keyCursor.next(-1);
- }
-
- nullSBTree.remove(null);
- nullSBTree.delete();
- }
}
private void cursorToSet(Set<OIdentifiable> identifiables, OSBTree.OSBTreeCursor<Integer, OIdentifiable> cursor) {
