• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Removed entity becomes managed?

 
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 ]
 
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
 
It's a tiny ad only because the water is so cold.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic