Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Transaction] ConcurrentModificationException while unloading a resource
[EMF Transaction] ConcurrentModificationException while unloading a resource [message #609414] Thu, 02 August 2007 15:18
Sascha Theves is currently offline Sascha ThevesFriend
Messages: 39
Registered: July 2009
Hi all,

we get sometimes ConcurrentModificationExceptions when we are about to
unload/load an EMF resource. Thats because a Thread iterates over the
resources in our common ResourceSet (we only have one) and another Thread
loads a resource - for example. We have written a thread-safe class that
does all the load and unload operations and all other components have to use
that class. This works now but it does not cover the following issue:

One Thread unloads a resource. Another Thread reads the model from the
resource that is being unloaded. These two Threads are not synchronized and
we get several Exceptions.

Our idea is now to use EMF Transaction and there, the READ/WRITE lock
mechanism to prevent these problems. But we are not sure if it is a good
idea to put the load/unload operations in the WRITE lock. Is there another
way to prevent these multithreading issues? Is the approach with EMF
Transaction necessary in load/unload operations? Is our approach with the
thread-safe class a better idea?

For testing purposes we have written several commands which
loading/unloading an EMF resource. These commands are executed in
CommandStack of the TransactionalEditingDomain.
But now we get sometimes a ConcurrentModificationException at
org.eclipse.emf.transaction.impl.ReadWriteValidatorImpl$Noti ficationTree.collectNotifications(ReadWriteValidatorImpl.jav a:405).
Means that unloading/loading of an EMF resource should not be done within a

Thanks in advance

Previous Topic:problem about deleting ojects with foreign key constrain
Next Topic:Incompatible type requested for parameter field (emf+teneo+jpox)
Goto Forum:

Current Time: Fri Aug 12 10:16:21 GMT 2022

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

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

Back to the top