Rollback Usage

18 views
Skip to first unread message

mm

unread,
Jun 15, 2011, 3:06:39 PM6/15/11
to GWT Dispatch
writing an action handler that deletes something is fairly straight
forward.
but what has to be done if a rollback is required?

I suppose in this case one has to backup a copy of the object to be
deleted.
but where is this to be stored? guess the action handler itself is not
the right
place because it is accessed by different threads (requests).

Is there any best practice or advice around?

Many thanks for your inputs!

Robert Munteanu

unread,
Jun 15, 2011, 4:44:09 PM6/15/11
to gwt-di...@googlegroups.com

Hi,

For deletion you can send the deleted object in the result, if it is
not too large. Otherwise, you need to have a location where you store
recently deleted objects and use that for recovery.

Robert

--
Sent from my (old) computer

Michael Monstein

unread,
Jun 15, 2011, 5:00:29 PM6/15/11
to gwt-di...@googlegroups.com
Dear Rob,

Having the object in the result seems to be the way to go in this case! Thanks for your answer!

Another Question: as far as i understand, the rollback is a server mechsnism. how does that affect the communication and the client?

Best,
Michael

-------- Original-Nachricht --------
> Datum: Wed, 15 Jun 2011 23:44:09 +0300
> Von: Robert Munteanu <robert....@gmail.com>
> An: gwt-di...@googlegroups.com
> Betreff: Re: [gwt-dispatch] Rollback Usage

--
NEU: FreePhone - kostenlos mobil telefonieren!
Jetzt informieren: http://www.gmx.net/de/go/freephone

David Peterson

unread,
Jun 15, 2011, 10:45:44 PM6/15/11
to gwt-di...@googlegroups.com
Yeah, it's a server mechanism. Essentially, it will kick in automatically on the server side if something fails, but you can also trigger it manually by sending the Result instance back to the server from the client side (provides 'undo' behaviour). Of course, not every rollback will succeed either, particularly if there have been other changes, so use it with care... Some actions simply can't be 'undone' (eg, sending an email, etc). Depends on the action.

Regards,

David
Reply all
Reply to author
Forward
0 new messages