You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by David Marginian <da...@davidmarginian.com> on 2015/11/17 23:32:32 UTC

Threading Question

https://jackrabbit.apache.org/oak/docs/construct.html

In a threaded environment (servlet, etc.) is it ok/recommended to create 
the repository/nodestore once and store as instance variables and then 
use the repository to create a new session per request?  I know that 
sessions should not be shared across threads but I wasn't sure about 
repositories.

Thanks!

Re: Threading Question

Posted by Chetan Mehrotra <ch...@gmail.com>.
Have a look at webapp example [1] for suggested setup. The repository
should be created once and then reused.

Chetan Mehrotra
[1] https://github.com/apache/jackrabbit-oak/tree/trunk/oak-examples/webapp


On Wed, Nov 18, 2015 at 4:02 AM, David Marginian
<da...@davidmarginian.com> wrote:
> https://jackrabbit.apache.org/oak/docs/construct.html
>
> In a threaded environment (servlet, etc.) is it ok/recommended to create the
> repository/nodestore once and store as instance variables and then use the
> repository to create a new session per request?  I know that sessions should
> not be shared across threads but I wasn't sure about repositories.
>
> Thanks!