jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Working with JCR in highly concurrent applications
Date Thu, 21 Sep 2006 23:00:01 GMT
Hi,

On 9/21/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com> wrote:
> There is still some not yet answered question about JCR Session usage:
> can it be used as a long-live object and shared between different
> threads? Is it dangerous to do so?

Yes. JCR sessions are not thread-safe so you should not try to use one
concurrently from multiple threads. If you want, you can use a
session-pool from which you borrow a sessions whenever one is needed
to avoid the session startup cost and to keep caches loaded.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Mime
View raw message