Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] OptimisticLockException
[Texo] OptimisticLockException [message #1060586] Mon, 27 May 2013 07:57 Go to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi Martin,

I just wanted to ask you, if there is an intended way to solve the following situation:

We have two client RCPs and one Texo server. One client deletes an object and immediately persists the changes via Texo. Meanwhile the other client changes the same object and tries to save the changes. Of course, the second client gets an exception (on the server it is the OptimisticLockException), since the object cannot be merged.

So is there an implemented way to deal with this in Texo? Like setting a parameter to not merge this object, but persist it instead (this might be more of an EclipseLink question). Otherwise my approach would be to send back a warning to inform the user.

Best regards
Bastian
Re: [Texo] OptimisticLockException [message #1060587 is a reply to message #1060586] Mon, 27 May 2013 08:00 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Bastian,
A variant of this is that the object has been changed since the last time it was loaded by the client. The software I
have worked with/developed in this case always gave a warning to the user 'Data changed by other user, please refresh
and apply your changes again'.
In your case I would give a 'Data has been deleted' warning to the user.

But there is no standard way of doing this, so you would need to catch the exception to see what the cause is on the
server and response to the client in the correct way.

gr. Martin

On 05/27/2013 09:57 AM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I just wanted to ask you, if there is an intended way to solve the following situation:
>
> We have two client RCPs and one Texo server. One client deletes an object and immediately persists the changes via Texo.
> Meanwhile the other client changes the same object and tries to save the changes. Of course, the second client gets an
> exception (on the server it is the OptimisticLockException), since the object cannot be merged.
>
> So is there an implemented way to deal with this in Texo? Like setting a parameter to not merge this object, but persist
> it instead (this might be more of an EclipseLink question). Otherwise my approach would be to send back a warning to
> inform the user.
> Best regards
> Bastian
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] OptimisticLockException [message #1060779 is a reply to message #1060587] Tue, 28 May 2013 12:21 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi Martin,

thanks four your reply. I started implementing a solution for this. To track the objects that produce the OptimisticLockException I used the EMF CommandStack and its result list. In some cases this does not work, so I wanted to ask you, if Texo provides a feature to retrieve the classes that led to an error. Or maybe just get the lists of objects that have been updated, added and deleted (in the TexoResource)?

I would be very glad for a little help Smile

Best regards
Bastian
Re: [Texo] OptimisticLockException [message #1060862 is a reply to message #1060779] Tue, 28 May 2013 18:08 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Bastian,
I think that this is best done on the server side, there it is known what fails, so not on the server side. But
currently Texo does not have a standard solution. You can override the server side components with your own
implementation to return more information:
http://wiki.eclipse.org/Texo/Components

In this case the UpdateInsertModelOperation component is the one to extend. You can check the source code to see what it
does.

gr. Martin

On 05/28/2013 02:21 PM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> thanks four your reply. I started implementing a solution for this. To track the objects that produce the
> OptimisticLockException I used the EMF CommandStack and its result list. In some cases this does not work, so I wanted
> to ask you, if Texo provides a feature to retrieve the classes that led to an error. Or maybe just get the lists of
> objects that have been updated, added and deleted (in the TexoResource)?
>
> I would be very glad for a little help :)
>
> Best regards
> Bastian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] OptimisticLockException [message #1060900 is a reply to message #1060862] Wed, 29 May 2013 05:18 Go to previous message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi Martin,

thanks for your advice. I'll try to do that soon.

Best regards
Bastian
Previous Topic:[Texo] "Incorrect" Wiki entry
Next Topic:Convert to EMF
Goto Forum:
  


Current Time: Thu Oct 23 19:14:18 GMT 2014

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

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