• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Remove Vs Managed Instance  RSS feed

 
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am a bit confused after reading JSR-317 Section 3.2.8(Managed Instances).

As far as I understand, if an entity is associated with a persistence context, it is managed.
And as per the spec: A managed entity instance is an instance with a persistent identity that is currently associated
with a persistence context.

Then why invoking contains on a removed entity will return false?

Please help me understand the concepts.

Many thanks in advance.
 
Creator of Enthuware JWS+ V6
Posts: 3273
296
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Then why invoking contains on a removed entity will return false?


The contains() method retuns false for a removed entity because you have decided that it isn't of use anymore (and on transaction commit the entity will be removed from the database). You are correct that it is still associated with the persistency context, but it won't play any other role than to be deleted from the database.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!