|
Re: [Texo] OptimisticLockException [message #1060587 is a reply to message #1060586] |
Mon, 27 May 2013 08:00 |
Martin Taal Messages: 5468 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 #1060862 is a reply to message #1060779] |
Tue, 28 May 2013 18:08 |
Martin Taal Messages: 5468 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04392 seconds