I was hoping for an option that wasn't quite as all-encompassing, but
yes, I think that would do the trick.
Patrick Casey wrote:
Would something as simple as this in your servelet's doService
method work for you?
protected void doService(HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException {
Clock c = new Clock();
HttpSession s = request.getSession();
fCurrentSession.set(s);
synchronized (s) {
super.doService(request, response);
}
String temp = "Total Render time = " + c;
Log.info(temp);
}
-----Original Message-----
From: Michael Prescott [mailto:[EMAIL PROTECTED]
Sent: Friday, August 26, 2005 8:28 AM
To: [email protected]
Subject: Design issue: synchronizing across callbacks?
I have an application where certain screens can only be shown based on a
user's state (in an underlying model). State changes with every page
request (merely viewing the page can mean you're in a new state).
Because users can double-click or click multiple links rapidly
(effectively making concurrent, incompatible requests), I need to
implement 'validity' checks correctly, redirecting requests for pages
that shouldn't be shown.
I can check the model's state in validate(), but that isn't sufficient
because a concurrent request to a different page might change the model
state immediately after the validate() call but before. I'm new enough
to Tapestry that I'm not sure how I can synchronize access to my model
at a scope that spans all of these callbacks.
What's the typical way of handling this sort of thing?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Michael Prescott
wk.(416) 646-7062
hm.(416) 686-8576
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]