On 6/29/06, Torgeir Veimo <[EMAIL PROTECTED]> wrote:
Tobias Bocanegra wrote:
> the creation of the session is indeed lightweight. but there are
> caches attached to the session that increase performance (especially
> the CachingHierarchyManager). whenever you close (i.e. logout) the
> session, you loose the cached information.
>
> in a web-based environment, with anonymous, access, i would have a
> pool of connected (i.e. logged-in) jcr-sessions, that are used for
> every request. this pool can have the size of 1, as long you are only
> doing read-only access.
>
> as soon you have write access, possible several modifications over
> multiple requests, with a 'save' at the end, you need to attach the
> jcr-session to the j2ee-session, so that the transient changes don't
> get lost, or mixed up with different users.
Just to clarify this; a node retrieved from a (read-only) session,
cannot be used to make modifications in another session?
no. every Node, Property, Workspace etc is bound to the session
it originated from.
in case you meant:
Just to clarify this; a node retrieved from a (read-only) session,
cannot be used to make modifications in another *thread*?
no. write operations are not thread-safe.
again, see "7.5 Thread-Safety Requirements" of the jsr 170 spec.
cheers
stefan
--
-Torgeir