Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » RefreshRepresentationsCommand causes Sirius to freeze
RefreshRepresentationsCommand causes Sirius to freeze [message #1321203] Tue, 29 April 2014 06:30 Go to next message
Florian Dunz is currently offline Florian DunzFriend
Messages: 20
Registered: March 2014
Junior Member
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 10:47 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 564
Registered: July 2009
Senior Member
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.


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: RefreshRepresentationsCommand causes Sirius to freeze [message #1321626 is a reply to message #1321541] Tue, 29 April 2014 11:51 Go to previous messageGo to next message
Florian Dunz is currently offline Florian DunzFriend
Messages: 20
Registered: March 2014
Junior Member
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 12:17]

Report message to a moderator

Re: RefreshRepresentationsCommand causes Sirius to freeze [message #1333943 is a reply to message #1321626] Mon, 05 May 2014 10:01 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 564
Registered: July 2009
Senior Member
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


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: RefreshRepresentationsCommand causes Sirius to freeze [message #1333960 is a reply to message #1333943] Mon, 05 May 2014 10:10 Go to previous message
Florian Dunz is currently offline Florian DunzFriend
Messages: 20
Registered: March 2014
Junior Member
Hi,
yes I understand that. Thank you for your effort anyways.

Florian
Previous Topic:Shapes with non-rectangular boundaries
Next Topic:Adding options to the style properties view
Goto Forum:
  


Current Time: Fri Apr 16 18:31:26 GMT 2021

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

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

Back to the top