On 9/7/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
> A thread local can't be used ofcourse because it is map that has to be
> shared across threads!

Yes, of course I got that. But while (t != null && t !=
Thread.currentThread()) looked to me like you are trying to achieve
something similar. Anyway, hopefully your new comments will clarify
that.

> Did you look at the code that releases the usedPages?
>
> Page.internalDetach() calls
> getSession().pageDetached(this);
>
> which does:
> usedPages.remove(page.getId());
>         notifyAll();

Yep, I got that. I wasn't afraid that the Session wouldn't get out of
it's wait state. I didn't/ don't get why you would throw an exception
when interrupted, while this would be not that unexpected.

> The InterruptedException can be ignored completely i guess. But it is such
> an rare case that that would
> happen.

Is it? If you give up the lock by calling wait, and another thread
accesses it in the mean time (1 sec window), it will happen.

> So throwing an exception looked fine to me. But we can just
> completely ignore it and try it again.
>
> This code is there to really make sure tha a page is only used by on request
> at the time!
> And no the normal RequestCycle lock is by far not good enough for that!
> Because page is used and altered before (in the getPage for example rollback
> of a page!)
> and after (page.detach cycle)

Yeah, ok. I'm starting to understand now. So what it would guarantee
is that processing on one box is properly synchronized. It doesn't
guarantee much in a clustered environment, right?

> It is just a barrier that can't be crossed before another request releases
> that page.
>
> I will update the code with some comments.

Thanks for that.

Eelco

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to