use of com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerShared in project orientdb by orientechnologies.
the class SBTreeBagDeleteTest method testDeleteRidbagTx.
@Test
public void testDeleteRidbagTx() {
ODocument doc = new ODocument();
ORidBag bag = new ORidBag();
int size = OGlobalConfiguration.INDEX_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.getValueAsInteger() * 2;
for (int i = 0; i < size; i++) bag.add(new ORecordId(10, i));
doc.field("bag", bag);
ORID id = db.save(doc).getIdentity();
bag = doc.field("bag");
OBonsaiCollectionPointer pointer = bag.getPointer();
db.begin();
db.delete(doc);
db.commit();
doc = db.load(id);
assertNull(doc);
((OSBTreeCollectionManagerShared) db.getSbTreeCollectionManager()).clear();
OSBTreeBonsai<OIdentifiable, Integer> tree = db.getSbTreeCollectionManager().loadSBTree(pointer);
assertNull(tree);
}
use of com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerShared in project orientdb by orientechnologies.
the class SBTreeBagDeleteTest method testDeleteRidbagNoTx.
@Test
public void testDeleteRidbagNoTx() {
ODocument doc = new ODocument();
ORidBag bag = new ORidBag();
int size = OGlobalConfiguration.INDEX_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.getValueAsInteger() * 2;
for (int i = 0; i < size; i++) bag.add(new ORecordId(10, i));
doc.field("bag", bag);
ORID id = db.save(doc).getIdentity();
bag = doc.field("bag");
OBonsaiCollectionPointer pointer = bag.getPointer();
db.delete(doc);
doc = db.load(id);
assertNull(doc);
((OSBTreeCollectionManagerShared) db.getSbTreeCollectionManager()).clear();
OSBTreeBonsai<OIdentifiable, Integer> tree = db.getSbTreeCollectionManager().loadSBTree(pointer);
assertNull(tree);
}
Aggregations