Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Hibernate flush causes transactional domain error
Hibernate flush causes transactional domain error [message #619276] Mon, 23 June 2008 20:18
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hi Martin,

I use the Eclipse 3.3 with the teneo version 0.8.0.v200805200858.
My actual problem in a GMF application is the auto flush of hibernate.
During a HibernatePersistabeElist.doLoad() a session is opened. With the
close of this session a hibernate flush occures. The database creates a
new key for a new persisted object. This key should be set into the model
but there is no actual transaction open in the Transactional Editing
Domain.
So I get the following exception:

java.lang.IllegalStateException: Cannot modify resource set without a
write transaction
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:322)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:284)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.p rocessObjectNotification(TransactionChangeRecorder.java:266)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.n otifyChanged(TransactionChangeRecorder.java:222)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:247)
at
de.edvchl.clic.workflow.datenabfrage.impl.DatabaseSyncObject Impl.setLogicKey(DatabaseSyncObjectImpl.java:172)
at
de.edvchl.clic.workflow.datenabfrage.impl.DatabaseSyncObject Impl.eSet(DatabaseSyncObjectImpl.java:290)
at
de.edvchl.clic.workflow.ausdruck.impl.AusdruckImpl.eSet(Ausd ruckImpl.java:189)
at
de.edvchl.clic.workflow.ausdruck.impl.KomplexerAusdruckImpl. eSet(KomplexerAusdruckImpl.java:364)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjec tImpl.java:1061)
at
org.eclipse.emf.teneo.hibernate.mapping.property.EAttributeP ropertyHandler.set(EAttributePropertyHandler.java:187)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.setIdentif ier(AbstractEntityTuplizer.java:211)
at
org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.setIden tifier(EMFTuplizer.java:116)
at
org.hibernate.persister.entity.AbstractEntityPersister.setId entifier(AbstractEntityPersister.java:3596)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:171)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:121)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
at
org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:218)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at
org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
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)
at
org.eclipse.emf.teneo.hibernate.HbSessionWrapper.commitTrans action(HbSessionWrapper.java:82)
at
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList.doLoad(HibernatePersistableEList.java:181)
at
org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(Pe rsistableEList.java:207)
at
org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:443)
at
org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
at
org.eclipse.emf.common.util.DelegatingEList$EIterator.hasNex t(DelegatingEList.java:1048)
at
org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator.ge tText(AdapterFactoryItemDelegator.java:69)
at
org.eclipse.emf.edit.provider.ItemPropertyDescriptor$ItemDel egator.getText(ItemPropertyDescriptor.java:201)
at
org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.getTex t(PropertyDescriptor.java:123)
at
org.eclipse.gmf.runtime.emf.ui.properties.sections.PropertyS heetEntry.getValueAsString(PropertySheetEntry.java:457)
at
org.eclipse.ui.views.properties.PropertySheetViewer.updateEn try(PropertySheetViewer.java:1335)
at
org.eclipse.ui.views.properties.PropertySheetViewer.access$4 (PropertySheetViewer.java:1326)
at
org.eclipse.ui.views.properties.PropertySheetViewer$3.valueC hanged(PropertySheetViewer.java:335)
at
org.eclipse.gmf.runtime.emf.ui.properties.sections.PropertyS heetEntry.fireValueChanged(PropertySheetEntry.java:316)
at
org.eclipse.gmf.runtime.emf.ui.properties.sections.PropertyS heetEntry.setValues(PropertySheetEntry.java:730)
....

I know that I can change the default behavior of the hibernate flush with
the FlushMode, but this time I do not have control over the session, it is
managed by teneo. And since the auto flush occures on the backstage I
don't know where to set the Editing Domain Transaction.
Do you have any advice how to handle this situation?

greetings from
Manfred
Previous Topic:Collide ID validation error
Next Topic:[CDO/Hibernate] Multiple issues
Goto Forum:
  


Current Time: Wed Apr 08 09:48:48 GMT 2020

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

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

Back to the top