Janne should advise us about this, if JCR is committed to the trunk, can we
help make it work ? Or will it stay broken for months.

You probably can, since we can get rid of a lot of obsolete classes (like all of the providers), and the entire WikiPage/WikiContext lifecycle needs rethinking.

To make it simple: The idea was to carry a JCR Session in the WikiContext, and tie the Node to the WikiPage. Unfortunately, our old method (and the new Stripes idea) is to create the WikiPage first, then the WikiContext from it. In JCR, we have to do it vice versa - first the WikiContext (to create the Session) and using that, the WikiPage (an object fetched using the Session). These are obviously incompatible.

I've been poking around with all sorts of intermediate solutions (wikicontexts without pages) but I haven't yet figured out anything that would not be a horrendous hack. To me this suggests that the entire lifecycle of WikiContext and WikiPage needs to be completely rethought.

Also, resource counting is a problem. Currently we just rely on the garbage collector to get rid of contexts and pages. However, Sessions need to be closed properly, so any thinking about the lifecycle needs to take that into account.

One option is to use ThreadLocals to store Sessions, but those still need cleanup when requests end. The problem being that it is unclear when the requests do end, since we have no lifecycle defined.

/Janne

Reply via email to