Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] IdentifierCacheHandler does not work for EObjects with hashCode implementations
[Teneo] IdentifierCacheHandler does not work for EObjects with hashCode implementations [message #602294] Wed, 07 February 2007 18:32
Michael Kanaley is currently offline Michael KanaleyFriend
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
Previous Topic:For those using Teneo from cvs: HEAD is Teneo for EMF 2.3 , Branch: R0_7_maintenance is EMF 2.2
Next Topic:[Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotations w
Goto Forum:
  


Current Time: Thu Apr 25 17:35:25 GMT 2024

Powered by FUDForum. Page generated in 0.03751 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top