On 25-05-2009 at 15:18, Michael Day wrote:
> On May 25, 2009, at 3:07 PM, Oscar Westra van Holthe - Kind wrote:
>
> >> I'm already doing exactly as you said (skip processing and redirect
> >> to
> >> result page immediately) in my submit handler by looking at the
> >> status
> >> of the order. If the status is Submitted, I'm just showing the
> >> result
> >> page. But for this to work properly, I have to obtain a pessimistic
> >> lock on the order at the beginning of the request.
> >
> > Or, update the order status in a transaction first, and then process
> > the
> > order in a second transaction afterwards. Especially with a
> > transaction
> > isolation of "serializable", this will ensure a second request can
> > only read
> > the updated order status.
>
> Hmmm. I think this is still problematic. The second request would
> see the "submitted" status on the order, so it would bypass the
> processing and show the result page. This could happen before the
> first request finished all of its work. The result page wouldn't have
> the correct information.
True. That's why I suggested earlier to use the flash scope: set a flag or
something to trigger the inclusion of a tag:
<meta http-equiv="refresh" content="3; URL='....'">
Since the flash scope is short lived, it would temporarily cause the page to
refresh after a short delay (3 seconds in this example). This automatically
updates the view to the then current situation.
So far I've encountered only one situation yet where this is not sufficient:
streaming price data on stock/bonds/options (this was a financial training
simulation).
Oscar
--
,-_ Oscar Westra van holthe - Kind http://www.xs4all.nl/~kindop/
/() )
(__ ( Clearly the Bush Presidency was divine punishment for the sinful
=/ () ways of the USA and the West that tagged along.
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users