[Teneo] IdentifierCacheHandler does not work for EObjects with hashCode implementations [message #602294] |
Wed, 07 February 2007 18:32 |
Michael Kanaley Messages: 89 Registered: July 2009 |
Member |
|
|
I've run into a problem with Teneo.
Some of my EObjects implement hashCode/equals using the properties stored in
the EObject.
It appears that Teneo updates the IdentifierCacheHandler.idMap before any of
the properties are set. The Key inserted into the idMap has a hashCode for
an "empty" object. Once all the properties are set and Hibernate is
retrieving the identity to see if it has changed, the Key used will not map
to the original one since all the properties have been set. This leads to an
exception similar to the following:
org.hibernate.HibernateException: identifier of an instance of
SomeModelObjectClass was altered from 1 to null
at
org.hibernate.event.def.DefaultFlushEntityEventListener.chec kId(DefaultFlushEntityEventListener.java:58)
at
org.hibernate.event.def.DefaultFlushEntityEventListener.getV alues(DefaultFlushEntityEventListener.java:157)
at
org.hibernate.event.def.DefaultFlushEntityEventListener.onFl ushEntity(DefaultFlushEntityEventListener.java:113)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE ntities(AbstractFlushingEventListener.java:196)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:76)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java :338)
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransac tion.java:106)
Is there any way to get around this issue without removing the
hashCode/equals implementations in my EObjects?
Thanks,
-mike
|
|
|
Powered by
FUDForum. Page generated in 0.03730 seconds