• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Removed entity becomes managed?

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic