[jboss-user] [JBossCache] - JBoss Caching and multiple Entity Manager issues

vfpeter do-not-reply at jboss.com
Thu Nov 8 17:30:18 EST 2007


I need to update our backup database server when I am writing to our current database server.

So I am using two Entity Managers to handle this  and pass the same Entity.

        em.persist(dmvActivity);
  |         em.flush();
  | 
  |         // write to HotSite DB
  |         emTml.persist(dmvActivity);
  |         emTml.flush();

This worked fine, till I made the entity cacheable. Now I get the following error :


javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: com.cp.mvr.common.ejb.persistence.DmvColor 


Further, if an entity is set as cacheable, everytime when you do a findAll does the cache get refreshed from the database?

Thanks,
Peter.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103119#4103119

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103119



More information about the jboss-user mailing list