I have tried to insert/update multiple entites on a single transaction but no avail. It always throws IllegalArgumentException.
I wanted to do something like this.
Transaction tx = pm.currentTransaction();
tx.begin();
for(int i=0;i<10;i++) {
SampleEntity entity = new SampleEntity(i);
pm.makePersistent(entity);
}
tx.commit();
If this is not possible, is there a workaround to make it work? Thanks.