Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Re: Deadlock in WorkspaceSynchronizer
Re: Deadlock in WorkspaceSynchronizer [message #602439] Fri, 09 February 2007 16:33
Eclipse UserFriend
Originally posted by:

Hi, Alex,

As Cherie indicates, the correct newsgroup for EMFT questions is (which I have copied).

Technically, a transaction is not required for saving or loading resources,
because transactions only protect the data contained by resources in the
resource set. So, one work-around for you would be to perform your
multi-resource save not in a transaction.

Of course, one does want to avoid the possibility of updates concurrent with
saving, which is the purpose of read-only transactions (in which save is
performed). So, possibly a better solution in the WorkspaceSynchronizer
would be to not do the runExclusive. I think this may not be necessary
because the default action always involves unloading the resource (custom
sync delegates may do more) and the synchronizer must assume that the
resource change may have been triggered within a transaction.

Please raise a bug, and I will investigate further.


Alex Shatalin wrote:

> Hello!
> While working with the WorkspaceSynchronizer I found a deadlock. For me it
> looks like a frequent situation, so can somebody from the runtime team
> review this posting and answer the question how to handle this situation
> correctly.
> Precondition: WorkspaceSynchronizer was instantiated and tracking any
> resource changes in the underlying ResourceSet.
> Thread-1: OpenEditPolicy.doExecuteWithResult() executed, model loaded into
> this ResourceSet was modified and saving action for whole ResourceSet was
> executed. First resource loaded into this ResourceSet saved using
> call.
> Thread-2: WorkspaceSynchronizer receive notification from the resource
> subsystem -> ResourceSynchJob executed and stopped in SynchRequest.
> Perform() method because of synch.getEditingDomain().runExclusive() call
> (Thread-1 AFAIU is currently inside a transaction in the same
> EditingDomain, so this call can not be satisfied).
> Thread-1: trying to save second resource from the same ResourceSet and
> stopped in: File.setContents() because of workspace.prepareOperation(rule,
> monitor); call. This operation is trying to execute job with the
> corresponding rule, but can not because WorkspaceSynchronizer.
> ResourceSynchJob is already running with the following rule:
> ResourcesPlugin.getWorkspace().getRoot().
> So, looks like this deadlock will show up any time we have
> WorkspaceSynchronizer running and trying to save more then one resource
> from within transaction executed on the same EditngDomain. My question is:
> should I submit a request for it? Or is there any other way to save
> resources correctly? (outside the transaction?)
> -----------------
> Alex Shatalin
Previous Topic:[Teneo] Dynamic mapping using XSDEcoreBuilder
Next Topic:[Teneo] EAttributePropertyHandler Warnings
Goto Forum:

Current Time: Fri Oct 30 20:00:45 GMT 2020

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

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

Back to the top