entity-manager

How to maintain EntityManager's cache with Hibernate under JBoss in a consistent state?

Hi! We are running JBoss with Hibernate and are having this issue. When a session bean uses an EntityManager to find an entity, it may already exist in the EntityManager's cache and it's state may be already outdated. If the code uses such an entity to make decisions, it may make wrong decisions that would produce bugs. Here is an exa...

How to force JBoss 4.2.3 to clear hibernate's session cache for every request?

Hi! It seems to me that JBoss reuses entity managers and the underlying hibernate sessions for multiple requests. I have run a test which proves that in some cases the state of an entity may be out-dated even if it is just fetched using em.find(). How can I disable this behaviour and force to clear or throw away used sessions to ensur...