RefreshRepresentationsCommand causes Sirius to freeze [message #1321203] |
Tue, 29 April 2014 02:30  |
Eclipse User |
|
|
|
Hi there,
I've been trying to write my own change handler. As parameters I receive only the changed EObject. As the resource is external Sirius seems to not recognize any changes.
TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
Session session = SessionManager.INSTANCE.getSession(eObject);
Collection<DRepresentation> allRepresentations = DialectManager.INSTANCE.getAllRepresentations(session);
Command cmd = new RefreshRepresentationsCommand(domain, new NullProgressMonitor(), allRepresentations);
if (cmd.canExecute()) {
domain.getCommandStack().execute(cmd);
}
The code above is what I got so far. However this causes Sirius to freeze. It appears to be some kind of deadlock as all threads are shown to be running however the UI won't respond anymore.
What have I done wrong?
Thanks,
Florian
|
|
|
Re: RefreshRepresentationsCommand causes Sirius to freeze [message #1321541 is a reply to message #1321203] |
Tue, 29 April 2014 06:47   |
Eclipse User |
|
|
|
Le 29/04/2014 08:30, Florian Dunz a écrit :
> Hi there,
Hi.
> I've been trying to write my own change handler. As parameters I receive
> only the changed EObject. As the resource is external Sirius seems to
> not recognize any changes.
I'm sorry but I don't understand what you mean by "change handler" or by
"the resource is external".
> TransactionalEditingDomain domain =
> TransactionUtil.getEditingDomain(eObject);
> Session session = SessionManager.INSTANCE.getSession(eObject);
>
> Collection<DRepresentation> allRepresentations =
> DialectManager.INSTANCE.getAllRepresentations(session);
>
> Command cmd = new RefreshRepresentationsCommand(domain, new
> NullProgressMonitor(), allRepresentations);
> if (cmd.canExecute()) {
> domain.getCommandStack().execute(cmd);
> }
> The code above is what I got so far.
> However this causes Sirius to
> freeze. It appears to be some kind of deadlock as all threads are shown
> to be running however the UI won't respond anymore.
> What have I done wrong?
I don't see anything obviously wrong here, but it all depends on the
context where the code is called, where the eObject comes from, etc. Do
the representations you refresh here work correctly when using Sirius
through the default UI (Modeling Project)?
If you are on Linux, we know there is a possible deadlock in some cases
(see https://bugs.eclipse.org/bugs/show_bug.cgi?id=433414), but it's a
long shot.
|
|
|
Re: RefreshRepresentationsCommand causes Sirius to freeze [message #1321626 is a reply to message #1321541] |
Tue, 29 April 2014 07:51   |
Eclipse User |
|
|
|
Hi,
thanks for the reply.
Sirius is running on windows. The model resource is saved in a cdo repository. Everything works fine, I'm able to connect, display everything, create new nodes,... I can commit changes and they are saved properly.
The only problem is receiving/displaying changes made on the cdo resource which weren't made directly from sirius itself. Out of the box sirius receives the changes made but does not refresh the representation. (Pressing F5 manually works fine, everything updates)
The handler I've been talking about is a CDOObjectHandler with an overwritten objectStateChanged method, code in previous post. The handler receives the invalidations, retrieves the domain, session and representations properly but as soon as the command is executed sirius freezes.
I hope this is more clear.
Florian
[Updated on: Tue, 29 April 2014 08:17] by Moderator
|
|
|
Re: RefreshRepresentationsCommand causes Sirius to freeze [message #1333943 is a reply to message #1321626] |
Mon, 05 May 2014 06:01   |
Eclipse User |
|
|
|
Le 29/04/2014 13:51, Florian Dunz a écrit :
> Hi,
Hi.
> thanks for the reply.
>
> The model resource is saved in a cdo repository. Everything works fine,
> I'm able to connect, display everything, create new nodes,... I can
> commit changes and they are saved properly.
As already mentioned in a previous exchange, working with CDO is not
supported out-of-the-box by Sirius itself. The integration between
Sirius and CDO comes with Obeo Designer, a commercial offer provided by
Obeo.
You are obviously free to try to make it work, but I hope you understand
that we (speaking for Obeo employees working on Sirius) will not assist
you for this work. Be aware though that such an integration is far from
trivial and requires significant development effort to get beyond a
simple "proof of concept".
Regards,
Pierre-Charles David
|
|
|
|
Powered by
FUDForum. Page generated in 0.10212 seconds