Skip to content

Instantly share code, notes, and snippets.

@shin1ogawa
Created May 14, 2009 10:12
Show Gist options
  • Save shin1ogawa/111603 to your computer and use it in GitHub Desktop.
Save shin1ogawa/111603 to your computer and use it in GitHub Desktop.
Transaction transaction = pm.currentTransaction();
try {
transaction.begin();
Parent2 target = (Parent2) pm.getObjectById(Parent2.class,
parent.getKey());
pm.deletePersistent(target);
transaction.commit();
} finally {
if (transaction.isActive()) {
transaction.rollback();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment