use of de.fhg.igd.mongomvcc.impl.MongoDBVDatabase in project mongomvcc by igd-geo.
the class IndexTest method stackOverflow.
/**
* This test checks if a stack overflows when there are too many commits in the database.
* See https://github.com/igd-geo/mongomvcc/pull/2 for more information.
* @throws StackOverflowError if the test fails
*/
@Test
@Ignore("Really slow. Not necessary in all situations. See GitHub issue for more information.")
public void stackOverflow() throws StackOverflowError {
VCollection persons = _master.getCollection("stack");
Map<String, Object> elvis = _factory.createDocument();
elvis.put("name", "elvis");
for (int i = 0; i < 2500; i++) {
persons.insert(elvis);
_master.commit();
}
VDatabase db = _factory.createDatabase();
db.connect(((MongoDBVDatabase) _db).getDB().getName());
VBranch master = db.checkout(VConstants.MASTER);
persons = master.getCollection("stack");
persons.find().size();
}
Aggregations