Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO/Hibernate] detaching objects with references
[CDO/Hibernate] detaching objects with references [message #990050] Mon, 10 December 2012 16:27
Erdal Karaca is currently offline Erdal Karaca
Messages: 744
Registered: July 2009
Senior Member
Not sure if this is really directly related to the hibernate store...

I have an object with some references (no containments).
Whenever I try to delete/detach that object using EcoreUtil.delete(object, true), I will get this exception:

Caused by: org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore: org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [NatuerlichePerson#e64987a9-73a0-49ac-8482-dc6ff5681580]
	at org.hibernate.internal.SessionImpl.forceFlush(SessionImpl.java:1139)
	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:182)
	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:114)
	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
	at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:641)
	at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:633)
	at org.hibernate.engine.spi.CascadingAction$5.cascade(CascadingAction.java:259)
	at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:380)
	at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:323)
	at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)
	at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:409)
	at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:350)
	at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:326)
	at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)
	at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
	at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:160)
	at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:151)
	at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)
	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
	at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1127)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:973)
	at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:151)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:531)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:46)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
	at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
	at org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:917)
	at org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:910)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:295)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:97)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:86)
	at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
	at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
	at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:65)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

	at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:84)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1181)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1205)


Is it OK to use EcoreUtil.delete() with CDO?
Previous Topic:[CDO] CommitException: This transaction has conflicts
Next Topic:[CDO/db4o store] Multi session/transaction problems
Goto Forum:
  


Current Time: Sun Sep 21 04:23:56 GMT 2014

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

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