It is probably not necessary to fetch the entity from the DB before
deleting it.
Session.delete() will work fine with a transient instance.
Session.delete() may throw an unrecoverable error if no matching id is
found in DB. Not sure.
EntityManager.remove() cannot take transient instance, but it may be able
to recover if no matching id is found.
Original issue reported on code.google.com by dwolvert on 9 Apr 2009 at 6:35
Original issue reported on code.google.com by
dwolvert
on 9 Apr 2009 at 6:35