try {
em.getTransaction().begin();
int graphSize = getGraphSize(); // > 1 only in NodeTest
int operCount = batchSize / graphSize;
for (int i = 0; i < operCount && !entityInventory.isEmpty(); i++) {
TestEntity t=entityInventory.pop();
//System.out.println(t.toString());
em.persist(t);
increaseActionCount(graphSize);
}
em.getTransaction().commit();