1

According to my understanding, CDOTransactions provide read-write access contained resources and objects. I have a resource Set that have two CDO resource File, resource1, resource2.

User1 having session1 and TransactionalEditingDomain1 opens CDOTransaction T1.

User2 having session2 and TransactionalEditingDomain2 opens CDOTransaction T2.

with T1, user1 creates a new CDO Object and adds to the resource1.

with T2, user2 creates a new CDO Object and adds to the resource2.

When user1 commits the transaction T1, it saves the changes but it throws an IllegalStateException mentioned below.

java.lang.IllegalStateException: Cannot modify resource set without a write transaction at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:284) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:240) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374) at org.eclipse.emf.common.notify.impl.NotificationChainImpl.dispatch(NotificationChainImpl.java:98) at org.eclipse.emf.common.notify.impl.NotificationChainImpl.dispatch(NotificationChainImpl.java:86) at org.eclipse.emf.internal.cdo.view.CDOViewImpl.sendDeltaNotifications(CDOViewImpl.java:1111) at org.eclipse.emf.internal.cdo.view.CDOViewImpl.doInvalidate(CDOViewImpl.java:999) at org.eclipse.emf.internal.cdo.view.CDOViewImpl$InvalidationRunnable.doRun(CDOViewImpl.java:1956) at org.eclipse.net4j.internal.util.concurrent.RunnableWithName.run(RunnableWithName.java:46) at org.eclipse.net4j.internal.util.concurrent.ExecutorWorkSerializer$1.run(ExecutorWorkSerializer.java:105) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

It would be great, if i could get an answer to this problem.

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
  • Can you paste the relevant parts of your code? That would make it easier to spot the problem – Stefan Winkler Feb 15 '18 at 16:13
  • Late, but this error happens when the EMF transaction is not active/started. Here you are using EMF transaction along with CDO Transactions. CDO doesn't by default make use of EMF transactions. In our case we do wrap our CDO transactions within an EMF transaction, but that is not a standard approach. – Alain P Aug 15 '21 at 18:12

0 Answers0