Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Removed entity becomes managed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Removed entity becomes managed?" Watch "Removed entity becomes managed?" New topic

Removed entity becomes managed?

no more user
Ranch Hand

Joined: Aug 07, 2002
Posts: 39

Taking a look at JPA specification (3.2.1)

...persist operation, applied to an entity X are as follows:
If X is a removed entity, it becomes managed.

but when I try to run a simple hibernate example:
Message m = em.find(Message.class, 32768L);

EntityNotFoundException: deleted entity passed to persist.

How can a removed entity becomes managed as a result of persist operation?? Am I missing something??

Please, any help?

[ December 10, 2006: Message edited by: Alexandre Lima ]
Lawrence Johnbosco

Joined: Dec 03, 2006
Posts: 21

It looks like, the provider you are using (Hibernate) is having some issues. When I tried with a similar example in Toplink ships with reference implementation of EJB Server ( Glassfish), it works for me.

Regards..Lawrence J
I agree. Here's the link:
subject: Removed entity becomes managed?
jQuery in Action, 3rd edition