This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Removed entity becomes managed?

 
no more user
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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:
...
em.setFlushMode(FlushModeType.COMMIT);
Message m = em.find(Message.class, 32768L);
em.remove(m);
em.persist(m);
...

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?

Thanks.
[ December 10, 2006: Message edited by: Alexandre Lima ]
 
Lawrence Johnbosco
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic