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 03:57 Go to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 91
Registered: January 2013
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 04:00 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5057
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 08:21 Go to previous message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 91
Registered: January 2013
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
Previous Topic:[Ecore Tools] Redundant builds
Next Topic:[Texo] "Incorrect" Wiki entry
Goto Forum:
  


Current Time: Tue May 28 12:33:46 EDT 2013

Powered by FUDForum. Page generated in 0.01897 seconds