Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] : VersionPropertyHandler returns null for dettached objects
[Teneo] : VersionPropertyHandler returns null for dettached objects [message #606999] Sat, 16 June 2007 15:57
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi,

I think the VersionPropertyHandler
(org.eclipse.emf.teneo.hibernate.mapping.property.VersionPro pertyHandler) may be causing me problems
in that it is returning null values when I attempt to reattach a dettached object.

If I create a new version of an object and assign it the same ID as one persisted in the DB, then
this should act in the same way as an object which has been retireved from persistent storage in
another session. But if I do this through Teneo it throws an error like:

java.lang.NullPointerException
at org.hibernate.type.IntegerType.next(IntegerType.java:59)
at org.hibernate.engine.Versioning.increment(Versioning.java:10 8)
at
org.hibernate.event.def.DefaultFlushEntityEventListener.getN extVersion(DefaultFlushEntityEventListener.java:358)
at
org.hibernate.event.def.DefaultFlushEntityEventListener.sche duleUpdate(DefaultFlushEntityEventListener.java:250)
at
org.hibernate.event.def.DefaultFlushEntityEventListener.onFl ushEntity(DefaultFlushEntityEventListener.java:121)
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
system.org.sdmx.registry.persistence.HibernateTestHarness.te stCreatingNewVersionOfExistingCategoryAndUpdating(HibernateT estHarness.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStar ter.java:32)

I can see from debugging the Teneo classes that the VersionPropertyHandler class is attempting to
look up version numbers for the dettached objects and is returning null. It does however
successfully return 0 as the version for new objects.

Is the VersionPropertyHandler acting correctly in assuming that there should always be a version
number in its IdentifierCacheHandler for dettached objects ? It seems that it should be checking for
versions in the DB if it finds that an object already exists.

regards

Duncan
Previous Topic:[TENEO] Hibernate update exception when updating existing data
Next Topic:[Teneo] Dynamic classes are mapped as static/generated
Goto Forum:
  


Current Time: Tue Apr 23 07:40:06 GMT 2024

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

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

Back to the top