here's the problem. Within a session, if an instance of Object1 is loaded and used, and then another Object2 is loaded, which has an Object1LightWeight, or Object1Proxy element, then the cache is hit and the original Object1 is found and assumed to be the right object. however, when it tries to return that object as either of the LightWeight, or Proxy classes, then it throws a classcast exception.
Code:
2004-01-20 16:00:01,820 DEBUG [net.sf.hibernate.impl.SessionImpl] resolved object in session cache [com.tibbett.controlling.hibernate.ProfitcenterLightWeight#3]
2004-01-20 16:00:02,387 ERROR [STDERR] java.lang.ClassCastException
at com.tibbett.controlling.hibernate.KeyPCSelectedListLightWeightMetaClass18.setPropertyValues(<generated>)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:162)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1961)
is this normal behavior? should hibernate not notice that these are different object types and go get the matching object?
We are using hibernate 2.0.2 on Jboss.
(if this has been fixed in a later version of hibernate.. that would be great :)))
Thnx
A.