long timeAllocate = System.currentTimeMillis();
pm.currentTransaction().begin();
//allocate
s.allocate(ADDITIONAL);
for (int i = 0; i < ADDITIONAL ; i++) {
phones[i] = new Phone();
phones[i].setName("phone " + i);
}
//make persistent
pm.makePersistentAll(phones);
pm.currentTransaction().commit();
timeAllocate = System.currentTimeMillis() - timeAllocate;
long timeNext = System.currentTimeMillis();
pm.currentTransaction().begin();
for (int i = ADDITIONAL; i < ADDITIONAL*2 ; i++) {
phones[i - ADDITIONAL] = new Phone();
phones[i - ADDITIONAL].setName("phone " + i);
}
//make persistent
pm.makePersistentAll(phones);
pm.currentTransaction().commit();