Hi,
I'm having difficulty after migrating from 2.1.6 to 3.0.5. I have an application that uses two different sessions. Not that it matters, but here's the reason I have implemented it this way. I have an application that must store three different versions of the same data in different tables. One table, for instance, is named PRODUCT. This is the table end users interact with when submitting data about a product. When the product is submitted in the workflow engine, it gets copied to a table named PRODUCT_REVIEW. Once the product is reviewed and approved, it moved to PRODUCT_PRODUCTION. Because these three tables have identical table structure (and a number of associated tables with the same naming pattern), I have been using NamingStrategy to alter the actual table the data is persisted to without having to map out the identical tables.
Anyhow, I'm sure somebody might take offense at my usage of NamingStrategy, but that's somewhat beside the point. My issue is that, since the upgrade, I receive HibernateException when I try to associate an object with a new session, even after I've called evict(object) or clear():
Code:
HibernateSessionFactory.currentSession().evict(c);
HibernateSessionFactory.currentSession().clear();
Session session = HibernateSessionFactoryReview.currentSession();
Transaction tx = session.beginTransaction();
session.replicate(c, ReplicationMode.OVERWRITE);
tx.commit();
session.close();
Code:
junit.framework.AssertionFailedError: com.greenbuildingpages.util.GBPException: org.hibernate.HibernateException: illegally attempted to associate a proxy with two open Sessions
...
Is this the way I should expect Hibernate to respond in 3.0, or is this a bug that is being addressed?
Thanks!