jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Nodes / Session
Date Mon, 11 Aug 2008 15:58:52 GMT
On Thu, Jul 24, 2008 at 6:50 PM, Luis Gervaso <luis.gervaso@gmail.com> wrote:
> Hi,
> I'm working on jcr servlet webapp
> when we use a database backend we use on the templates (jsp or freemarker) a
> disconnected dataset, that is we map the database resultset
> to an arraylist of bean.
> when we use jcr, i think the real power is the data type less structure
> so what is the correct approach?
> open a session and close it in a servlet filter? working with "connected
> resultset" ?

A good approach is to have one session per request (as you said,
servlet filters are good to create and close a session for the request

Creating a session is a quick thing in Jackrabbit (with a local
repository), so it is no problem to create them at different places.
But if you read the properties of many nodes again and again, it is
more efficient to keep the same session and remember the node objects.
BTW, you can often use the Node object like a DAO, so no need to wrap
them once again in most cases.


Alexander Klimetschek

View raw message