Writing to the datastore without closing Persistence Manager

63 Views Asked by At

How to commit to the database when updating an object using PersistenceManager without closing it?

1

There are 1 best solutions below

0
On

You need to commit the transaction. You don't need to close the PersistenceManager.

PersistenceManager p;
...
p.currentTransaction().begin();
.... //do the work
p.currentTransaction().commit();