• Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieving clean Entity from EntityManager  RSS feed

Chris Miles
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Afternoon,

I am using Hibernate behing JPA and have the following problem.

My application pulls an entity out using the find operation of the
EntityManager, and then somewhere else in my application I want to pull
the same Entity out again cleanly with the current database state rather
than the dirty version but any time I try I get the same dirty data.

I have tried to detach the dirty version and then fetch the Entity again
but it is still same.

I have also tried the CacheRetrieveMode.BYPASS hint on the fetch in case
it is a caching problem.

How can I fetch a clean instance of my Entity side by side with the dirty



It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!