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

> 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.


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
Wicket-user mailing list

Reply via email to