You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Ted Roeloffzen <te...@gmail.com> on 2006/10/16 10:59:22 UTC

is jackrabbit Threadsafe?

I would really like to know if JackRabbit is threadsafe.

Greets,

Ted

Re: is jackrabbit Threadsafe?

Posted by Ted Roeloffzen <te...@gmail.com>.
we are planning to make a CMS using Wicket, maybe you've heard of it, and
JackRabbit. We'll start very simple, by creating a blog and expand it later

On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
>
> Another way to handle this is to create a pool of sessions and use
> them for different request threads. You avoid the creation overhead
> this way while still having per-thread sessions.
>
> Also worth noting that there are still some known bugs around
> concurrent access to versioning operations within transactions.
> Whether this will affect you depends on what you're planning to do of
> course.
>
> m
>
>
> On 10/16/06, Michael Neale <mi...@gmail.com> wrote:
> > Session creation seems to be fast after the first hit, fast enough for
> pre
> > request cycles. You can always wrap stuff with threadsafe code to
> protect
> > access if you want a per http session scenario.
> >
> > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > >
> > > But when you use different Sessions for all request cycles, you will
> have
> > > to
> > > login all the time and this will kill your performance, or am i
> wrong??
> > >
> > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > >
> > > > So how would you do it?
> > > >
> > > >
> > > > On 10/16/06, Alexandru Popescu <th...@gmail.com>
> > > > wrote:
> > > > >
> > > > > On 10/16/06, Ted Roeloffzen < ted.roeloffzen@gmail.com> wrote:
> > > > > > So we don't have to create a variable for the JackRabbit session
> in
> > > > > the
> > > > > > HTTP-session,
> > > > >
> > > > > I would say that this is in fact not recommended. Imagine what
> happens
> > > > > with 2 concurrent requests that are using the same HttpSession? Is
> the
> > > > > JCR Session still used in a thread safe manner?
> > > > >
> > > > > ./alex
> > > > > --
> > > > > .w( the_mindstorm )p.
> > > > >
> > > > > > but we can use it in a request-cycle?? We are now using a
> > > > > > simple Abstract class en getting the session from it.
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 10/16/06, Alexandru Popescu <
> the.mindstorm.mailinglist@gmail.com>
> > > > > wrote:
> > > > > > >
> > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > > So when using it in a Web-application, every HTTP-session
> has to
> > > > > have
> > > > > > > its
> > > > > > > > own JackRabbit-session. So then it would be threadsafe?
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > I think you should think about it in request-scope and not on
> Http
> > > > > > > session scope. Only request-response cycles are guaranteed to
> > > happen
> > > > > > > on the same thread.
> > > > > > >
> > > > > > > ./alex
> > > > > > > --
> > > > > > > .w( the_mindstorm )p.
> > > > > > >
> > > > > > > > On 10/16/06, Tobias Bocanegra < tobias.bocanegra@day.com>
> wrote:
> > > > > > > > >
> > > > > > > > > if every thread uses it's own jcr session, yes.
> > > > > > > > > regards, toby
> > > > > > > > >
> > > > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com>
> wrote:
> > > > > > > > > > I would really like to know if JackRabbit is threadsafe.
> > > > > > > > > >
> > > > > > > > > > Greets,
> > > > > > > > > >
> > > > > > > > > > Ted
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > -----------------------------------------<
> > > > > tobias.bocanegra@day.com>---
> > > > > > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH
> -
> > > > > 4001
> > > > > > > Basel
> > > > > > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > > > > > -----------------------------------------------<
> > > > > http://www.day.com>---
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>

Re: Re: is jackrabbit Threadsafe?

Posted by Alexandru Popescu <th...@gmail.com>.
On 10/17/06, robert burrell donkin <ro...@gmail.com> wrote:
> On 10/16/06, Alexandru Popescu <th...@gmail.com> wrote:
> > On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
> > > (could people please avoid top posting: it makes it very difficult to
> > > include enough context)
> > >
> > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > In what way would that influence the performance?
> > >
> > > (see below)
> > >
> > > > On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
> > > > >
> > > > > On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> > > > > > This is something we have developed in-house for a client. I'll have
> > > > > > to ask our client about the possibility of contributing back (and see
> > > > > > how feasible it is to unpick it from the application itself), but if
> > > > > > they agree I'm happy to do so.
> > > > >
> > > > > if that's not possible, it should be possible to use jakarta commons-pool
> > >
> > > commons-pool is an object pool. one use case is connection pooling for
> > > data sources. session pooling sounds like another good match.
> > >
> >
> > I don't know much about commons-pool, so here are a couple of
> > questions before further investigating:
> >
> > - can you configure commons-pool to grow/shrink appropriately?
>
> it's reasonable configurable but the question of appropriateness
> depends on the application
>
> http://jakarta.apache.org/commons/pool/apidocs/org/apache/commons/pool/impl/GenericObjectPool.html
>
> > - can you configure commons-pool with some code that should be used to
> > create new objects available in the pool?
> > - can you configure commons-pool with some code that should be used to
> > destroy/clean objects from the pool?
>
> both these are managed by a factory
>
> http://jakarta.apache.org/commons/pool/apidocs/org/apache/commons/pool/PoolableObjectFactory.html
>

Thanks. Looks interesting and I guess you don't need to do too much to
have a decent JCR session pool.

./alex
--
.w( the_mindstorm )p.

> - robert
>

Re: Re: is jackrabbit Threadsafe?

Posted by robert burrell donkin <ro...@gmail.com>.
On 10/16/06, Alexandru Popescu <th...@gmail.com> wrote:
> On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
> > (could people please avoid top posting: it makes it very difficult to
> > include enough context)
> >
> > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > In what way would that influence the performance?
> >
> > (see below)
> >
> > > On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
> > > >
> > > > On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> > > > > This is something we have developed in-house for a client. I'll have
> > > > > to ask our client about the possibility of contributing back (and see
> > > > > how feasible it is to unpick it from the application itself), but if
> > > > > they agree I'm happy to do so.
> > > >
> > > > if that's not possible, it should be possible to use jakarta commons-pool
> >
> > commons-pool is an object pool. one use case is connection pooling for
> > data sources. session pooling sounds like another good match.
> >
>
> I don't know much about commons-pool, so here are a couple of
> questions before further investigating:
>
> - can you configure commons-pool to grow/shrink appropriately?

it's reasonable configurable but the question of appropriateness
depends on the application

http://jakarta.apache.org/commons/pool/apidocs/org/apache/commons/pool/impl/GenericObjectPool.html

> - can you configure commons-pool with some code that should be used to
> create new objects available in the pool?
> - can you configure commons-pool with some code that should be used to
> destroy/clean objects from the pool?

both these are managed by a factory

http://jakarta.apache.org/commons/pool/apidocs/org/apache/commons/pool/PoolableObjectFactory.html

- robert

Re: Re: is jackrabbit Threadsafe?

Posted by Alexandru Popescu <th...@gmail.com>.
On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
> (could people please avoid top posting: it makes it very difficult to
> include enough context)
>
> On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > In what way would that influence the performance?
>
> (see below)
>
> > On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
> > >
> > > On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> > > > This is something we have developed in-house for a client. I'll have
> > > > to ask our client about the possibility of contributing back (and see
> > > > how feasible it is to unpick it from the application itself), but if
> > > > they agree I'm happy to do so.
> > >
> > > if that's not possible, it should be possible to use jakarta commons-pool
>
> commons-pool is an object pool. one use case is connection pooling for
> data sources. session pooling sounds like another good match.
>

I don't know much about commons-pool, so here are a couple of
questions before further investigating:

- can you configure commons-pool to grow/shrink appropriately?
- can you configure commons-pool with some code that should be used to
create new objects available in the pool?
- can you configure commons-pool with some code that should be used to
destroy/clean objects from the pool?

Without these, I think there is enough work needed to make it work.

./alex
--
.w( the_mindstorm )p.

> - robert
>

Re: Re: is jackrabbit Threadsafe?

Posted by robert burrell donkin <ro...@gmail.com>.
(could people please avoid top posting: it makes it very difficult to
include enough context)

On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> In what way would that influence the performance?

(see below)

> On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
> >
> > On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> > > This is something we have developed in-house for a client. I'll have
> > > to ask our client about the possibility of contributing back (and see
> > > how feasible it is to unpick it from the application itself), but if
> > > they agree I'm happy to do so.
> >
> > if that's not possible, it should be possible to use jakarta commons-pool

commons-pool is an object pool. one use case is connection pooling for
data sources. session pooling sounds like another good match.

- robert

Re: Re: is jackrabbit Threadsafe?

Posted by Ted Roeloffzen <te...@gmail.com>.
In what way would that influence the performance?




On 10/16/06, robert burrell donkin <ro...@gmail.com> wrote:
>
> On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> > This is something we have developed in-house for a client. I'll have
> > to ask our client about the possibility of contributing back (and see
> > how feasible it is to unpick it from the application itself), but if
> > they agree I'm happy to do so.
>
> if that's not possible, it should be possible to use jakarta commons-pool
>
> - robert
>

Re: Re: is jackrabbit Threadsafe?

Posted by robert burrell donkin <ro...@gmail.com>.
On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> This is something we have developed in-house for a client. I'll have
> to ask our client about the possibility of contributing back (and see
> how feasible it is to unpick it from the application itself), but if
> they agree I'm happy to do so.

if that's not possible, it should be possible to use jakarta commons-pool

- robert

Re: is jackrabbit Threadsafe?

Posted by Miro Walker <mi...@gmail.com>.
This is something we have developed in-house for a client. I'll have
to ask our client about the possibility of contributing back (and see
how feasible it is to unpick it from the application itself), but if
they agree I'm happy to do so.

Miro

On 10/16/06, Alexandru Popescu <th...@gmail.com> wrote:
> On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> > Another way to handle this is to create a pool of sessions and use
> > them for different request threads. You avoid the creation overhead
> > this way while still having per-thread sessions.
> >
> > Also worth noting that there are still some known bugs around
> > concurrent access to versioning operations within transactions.
> > Whether this will affect you depends on what you're planning to do of
> > course.
> >
>
> Miro, I think I am remembering you posting about this JCR Session
> pool. Is this a solution you have developed in house or is it
> based/contributed back to the community?
>
> tia,
>
> ./alex
> --
> .w( the_mindstorm )p.
>
> > m
> >
> >
> > On 10/16/06, Michael Neale <mi...@gmail.com> wrote:
> > > Session creation seems to be fast after the first hit, fast enough for pre
> > > request cycles. You can always wrap stuff with threadsafe code to protect
> > > access if you want a per http session scenario.
> > >
> > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > >
> > > > But when you use different Sessions for all request cycles, you will have
> > > > to
> > > > login all the time and this will kill your performance, or am i wrong??
> > > >
> > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > >
> > > > > So how would you do it?
> > > > >
> > > > >
> > > > > On 10/16/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com >
> > > > > wrote:
> > > > > >
> > > > > > On 10/16/06, Ted Roeloffzen < ted.roeloffzen@gmail.com> wrote:
> > > > > > > So we don't have to create a variable for the JackRabbit session in
> > > > > > the
> > > > > > > HTTP-session,
> > > > > >
> > > > > > I would say that this is in fact not recommended. Imagine what happens
> > > > > > with 2 concurrent requests that are using the same HttpSession? Is the
> > > > > > JCR Session still used in a thread safe manner?
> > > > > >
> > > > > > ./alex
> > > > > > --
> > > > > > .w( the_mindstorm )p.
> > > > > >
> > > > > > > but we can use it in a request-cycle?? We are now using a
> > > > > > > simple Abstract class en getting the session from it.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 10/16/06, Alexandru Popescu <th...@gmail.com>
> > > > > > wrote:
> > > > > > > >
> > > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > > > So when using it in a Web-application, every HTTP-session has to
> > > > > > have
> > > > > > > > its
> > > > > > > > > own JackRabbit-session. So then it would be threadsafe?
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > > I think you should think about it in request-scope and not on Http
> > > > > > > > session scope. Only request-response cycles are guaranteed to
> > > > happen
> > > > > > > > on the same thread.
> > > > > > > >
> > > > > > > > ./alex
> > > > > > > > --
> > > > > > > > .w( the_mindstorm )p.
> > > > > > > >
> > > > > > > > > On 10/16/06, Tobias Bocanegra < tobias.bocanegra@day.com> wrote:
> > > > > > > > > >
> > > > > > > > > > if every thread uses it's own jcr session, yes.
> > > > > > > > > > regards, toby
> > > > > > > > > >
> > > > > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > > > > > I would really like to know if JackRabbit is threadsafe.
> > > > > > > > > > >
> > > > > > > > > > > Greets,
> > > > > > > > > > >
> > > > > > > > > > > Ted
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > -----------------------------------------<
> > > > > > tobias.bocanegra@day.com>---
> > > > > > > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH -
> > > > > > 4001
> > > > > > > > Basel
> > > > > > > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > > > > > > -----------------------------------------------<
> > > > > > http://www.day.com>---
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>

Re: is jackrabbit Threadsafe?

Posted by Alexandru Popescu <th...@gmail.com>.
On 10/16/06, Miro Walker <mi...@gmail.com> wrote:
> Another way to handle this is to create a pool of sessions and use
> them for different request threads. You avoid the creation overhead
> this way while still having per-thread sessions.
>
> Also worth noting that there are still some known bugs around
> concurrent access to versioning operations within transactions.
> Whether this will affect you depends on what you're planning to do of
> course.
>

Miro, I think I am remembering you posting about this JCR Session
pool. Is this a solution you have developed in house or is it
based/contributed back to the community?

tia,

./alex
--
.w( the_mindstorm )p.

> m
>
>
> On 10/16/06, Michael Neale <mi...@gmail.com> wrote:
> > Session creation seems to be fast after the first hit, fast enough for pre
> > request cycles. You can always wrap stuff with threadsafe code to protect
> > access if you want a per http session scenario.
> >
> > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > >
> > > But when you use different Sessions for all request cycles, you will have
> > > to
> > > login all the time and this will kill your performance, or am i wrong??
> > >
> > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > >
> > > > So how would you do it?
> > > >
> > > >
> > > > On 10/16/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com >
> > > > wrote:
> > > > >
> > > > > On 10/16/06, Ted Roeloffzen < ted.roeloffzen@gmail.com> wrote:
> > > > > > So we don't have to create a variable for the JackRabbit session in
> > > > > the
> > > > > > HTTP-session,
> > > > >
> > > > > I would say that this is in fact not recommended. Imagine what happens
> > > > > with 2 concurrent requests that are using the same HttpSession? Is the
> > > > > JCR Session still used in a thread safe manner?
> > > > >
> > > > > ./alex
> > > > > --
> > > > > .w( the_mindstorm )p.
> > > > >
> > > > > > but we can use it in a request-cycle?? We are now using a
> > > > > > simple Abstract class en getting the session from it.
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 10/16/06, Alexandru Popescu <th...@gmail.com>
> > > > > wrote:
> > > > > > >
> > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > > So when using it in a Web-application, every HTTP-session has to
> > > > > have
> > > > > > > its
> > > > > > > > own JackRabbit-session. So then it would be threadsafe?
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > I think you should think about it in request-scope and not on Http
> > > > > > > session scope. Only request-response cycles are guaranteed to
> > > happen
> > > > > > > on the same thread.
> > > > > > >
> > > > > > > ./alex
> > > > > > > --
> > > > > > > .w( the_mindstorm )p.
> > > > > > >
> > > > > > > > On 10/16/06, Tobias Bocanegra < tobias.bocanegra@day.com> wrote:
> > > > > > > > >
> > > > > > > > > if every thread uses it's own jcr session, yes.
> > > > > > > > > regards, toby
> > > > > > > > >
> > > > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > > > > I would really like to know if JackRabbit is threadsafe.
> > > > > > > > > >
> > > > > > > > > > Greets,
> > > > > > > > > >
> > > > > > > > > > Ted
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > -----------------------------------------<
> > > > > tobias.bocanegra@day.com>---
> > > > > > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH -
> > > > > 4001
> > > > > > > Basel
> > > > > > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > > > > > -----------------------------------------------<
> > > > > http://www.day.com>---
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>

Re: is jackrabbit Threadsafe?

Posted by Miro Walker <mi...@gmail.com>.
Another way to handle this is to create a pool of sessions and use
them for different request threads. You avoid the creation overhead
this way while still having per-thread sessions.

Also worth noting that there are still some known bugs around
concurrent access to versioning operations within transactions.
Whether this will affect you depends on what you're planning to do of
course.

m


On 10/16/06, Michael Neale <mi...@gmail.com> wrote:
> Session creation seems to be fast after the first hit, fast enough for pre
> request cycles. You can always wrap stuff with threadsafe code to protect
> access if you want a per http session scenario.
>
> On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> >
> > But when you use different Sessions for all request cycles, you will have
> > to
> > login all the time and this will kill your performance, or am i wrong??
> >
> > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > >
> > > So how would you do it?
> > >
> > >
> > > On 10/16/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com >
> > > wrote:
> > > >
> > > > On 10/16/06, Ted Roeloffzen < ted.roeloffzen@gmail.com> wrote:
> > > > > So we don't have to create a variable for the JackRabbit session in
> > > > the
> > > > > HTTP-session,
> > > >
> > > > I would say that this is in fact not recommended. Imagine what happens
> > > > with 2 concurrent requests that are using the same HttpSession? Is the
> > > > JCR Session still used in a thread safe manner?
> > > >
> > > > ./alex
> > > > --
> > > > .w( the_mindstorm )p.
> > > >
> > > > > but we can use it in a request-cycle?? We are now using a
> > > > > simple Abstract class en getting the session from it.
> > > > >
> > > > >
> > > > >
> > > > > On 10/16/06, Alexandru Popescu <th...@gmail.com>
> > > > wrote:
> > > > > >
> > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > So when using it in a Web-application, every HTTP-session has to
> > > > have
> > > > > > its
> > > > > > > own JackRabbit-session. So then it would be threadsafe?
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > I think you should think about it in request-scope and not on Http
> > > > > > session scope. Only request-response cycles are guaranteed to
> > happen
> > > > > > on the same thread.
> > > > > >
> > > > > > ./alex
> > > > > > --
> > > > > > .w( the_mindstorm )p.
> > > > > >
> > > > > > > On 10/16/06, Tobias Bocanegra < tobias.bocanegra@day.com> wrote:
> > > > > > > >
> > > > > > > > if every thread uses it's own jcr session, yes.
> > > > > > > > regards, toby
> > > > > > > >
> > > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > > > I would really like to know if JackRabbit is threadsafe.
> > > > > > > > >
> > > > > > > > > Greets,
> > > > > > > > >
> > > > > > > > > Ted
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > -----------------------------------------<
> > > > tobias.bocanegra@day.com>---
> > > > > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH -
> > > > 4001
> > > > > > Basel
> > > > > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > > > > -----------------------------------------------<
> > > > http://www.day.com>---
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
>
>

Re: is jackrabbit Threadsafe?

Posted by Michael Neale <mi...@gmail.com>.
Session creation seems to be fast after the first hit, fast enough for pre
request cycles. You can always wrap stuff with threadsafe code to protect
access if you want a per http session scenario.

On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
>
> But when you use different Sessions for all request cycles, you will have
> to
> login all the time and this will kill your performance, or am i wrong??
>
> On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> >
> > So how would you do it?
> >
> >
> > On 10/16/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com >
> > wrote:
> > >
> > > On 10/16/06, Ted Roeloffzen < ted.roeloffzen@gmail.com> wrote:
> > > > So we don't have to create a variable for the JackRabbit session in
> > > the
> > > > HTTP-session,
> > >
> > > I would say that this is in fact not recommended. Imagine what happens
> > > with 2 concurrent requests that are using the same HttpSession? Is the
> > > JCR Session still used in a thread safe manner?
> > >
> > > ./alex
> > > --
> > > .w( the_mindstorm )p.
> > >
> > > > but we can use it in a request-cycle?? We are now using a
> > > > simple Abstract class en getting the session from it.
> > > >
> > > >
> > > >
> > > > On 10/16/06, Alexandru Popescu <th...@gmail.com>
> > > wrote:
> > > > >
> > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > So when using it in a Web-application, every HTTP-session has to
> > > have
> > > > > its
> > > > > > own JackRabbit-session. So then it would be threadsafe?
> > > > > >
> > > > > >
> > > > >
> > > > > I think you should think about it in request-scope and not on Http
> > > > > session scope. Only request-response cycles are guaranteed to
> happen
> > > > > on the same thread.
> > > > >
> > > > > ./alex
> > > > > --
> > > > > .w( the_mindstorm )p.
> > > > >
> > > > > > On 10/16/06, Tobias Bocanegra < tobias.bocanegra@day.com> wrote:
> > > > > > >
> > > > > > > if every thread uses it's own jcr session, yes.
> > > > > > > regards, toby
> > > > > > >
> > > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > > I would really like to know if JackRabbit is threadsafe.
> > > > > > > >
> > > > > > > > Greets,
> > > > > > > >
> > > > > > > > Ted
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > -----------------------------------------<
> > > tobias.bocanegra@day.com>---
> > > > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH -
> > > 4001
> > > > > Basel
> > > > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > > > -----------------------------------------------<
> > > http://www.day.com>---
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>
>

Re: is jackrabbit Threadsafe?

Posted by Ted Roeloffzen <te...@gmail.com>.
But when you use different Sessions for all request cycles, you will have to
login all the time and this will kill your performance, or am i wrong??

On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
>
> So how would you do it?
>
>
> On 10/16/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com >
> wrote:
> >
> > On 10/16/06, Ted Roeloffzen < ted.roeloffzen@gmail.com> wrote:
> > > So we don't have to create a variable for the JackRabbit session in
> > the
> > > HTTP-session,
> >
> > I would say that this is in fact not recommended. Imagine what happens
> > with 2 concurrent requests that are using the same HttpSession? Is the
> > JCR Session still used in a thread safe manner?
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >
> > > but we can use it in a request-cycle?? We are now using a
> > > simple Abstract class en getting the session from it.
> > >
> > >
> > >
> > > On 10/16/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com >
> > wrote:
> > > >
> > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > So when using it in a Web-application, every HTTP-session has to
> > have
> > > > its
> > > > > own JackRabbit-session. So then it would be threadsafe?
> > > > >
> > > > >
> > > >
> > > > I think you should think about it in request-scope and not on Http
> > > > session scope. Only request-response cycles are guaranteed to happen
> > > > on the same thread.
> > > >
> > > > ./alex
> > > > --
> > > > .w( the_mindstorm )p.
> > > >
> > > > > On 10/16/06, Tobias Bocanegra < tobias.bocanegra@day.com> wrote:
> > > > > >
> > > > > > if every thread uses it's own jcr session, yes.
> > > > > > regards, toby
> > > > > >
> > > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > > I would really like to know if JackRabbit is threadsafe.
> > > > > > >
> > > > > > > Greets,
> > > > > > >
> > > > > > > Ted
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > -----------------------------------------<
> > tobias.bocanegra@day.com>---
> > > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH -
> > 4001
> > > > Basel
> > > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > > -----------------------------------------------<
> > http://www.day.com>---
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: is jackrabbit Threadsafe?

Posted by Ted Roeloffzen <te...@gmail.com>.
So how would you do it?


On 10/16/06, Alexandru Popescu <th...@gmail.com> wrote:
>
> On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > So we don't have to create a variable for the JackRabbit session in the
> > HTTP-session,
>
> I would say that this is in fact not recommended. Imagine what happens
> with 2 concurrent requests that are using the same HttpSession? Is the
> JCR Session still used in a thread safe manner?
>
> ./alex
> --
> .w( the_mindstorm )p.
>
> > but we can use it in a request-cycle?? We are now using a
> > simple Abstract class en getting the session from it.
> >
> >
> >
> > On 10/16/06, Alexandru Popescu <th...@gmail.com>
> wrote:
> > >
> > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > So when using it in a Web-application, every HTTP-session has to
> have
> > > its
> > > > own JackRabbit-session. So then it would be threadsafe?
> > > >
> > > >
> > >
> > > I think you should think about it in request-scope and not on Http
> > > session scope. Only request-response cycles are guaranteed to happen
> > > on the same thread.
> > >
> > > ./alex
> > > --
> > > .w( the_mindstorm )p.
> > >
> > > > On 10/16/06, Tobias Bocanegra <to...@day.com> wrote:
> > > > >
> > > > > if every thread uses it's own jcr session, yes.
> > > > > regards, toby
> > > > >
> > > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > > I would really like to know if JackRabbit is threadsafe.
> > > > > >
> > > > > > Greets,
> > > > > >
> > > > > > Ted
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > -----------------------------------------<
> tobias.bocanegra@day.com>---
> > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
> > > Basel
> > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > -----------------------------------------------<
> http://www.day.com>---
> > > > >
> > > >
> > > >
> > >
> >
> >
>

Re: is jackrabbit Threadsafe?

Posted by Alexandru Popescu <th...@gmail.com>.
On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> So we don't have to create a variable for the JackRabbit session in the
> HTTP-session,

I would say that this is in fact not recommended. Imagine what happens
with 2 concurrent requests that are using the same HttpSession? Is the
JCR Session still used in a thread safe manner?

./alex
--
.w( the_mindstorm )p.

> but we can use it in a request-cycle?? We are now using a
> simple Abstract class en getting the session from it.
>
>
>
> On 10/16/06, Alexandru Popescu <th...@gmail.com> wrote:
> >
> > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > So when using it in a Web-application, every HTTP-session has to have
> > its
> > > own JackRabbit-session. So then it would be threadsafe?
> > >
> > >
> >
> > I think you should think about it in request-scope and not on Http
> > session scope. Only request-response cycles are guaranteed to happen
> > on the same thread.
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >
> > > On 10/16/06, Tobias Bocanegra <to...@day.com> wrote:
> > > >
> > > > if every thread uses it's own jcr session, yes.
> > > > regards, toby
> > > >
> > > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > > I would really like to know if JackRabbit is threadsafe.
> > > > >
> > > > > Greets,
> > > > >
> > > > > Ted
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > -----------------------------------------< tobias.bocanegra@day.com>---
> > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
> > Basel
> > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > -----------------------------------------------< http://www.day.com>---
> > > >
> > >
> > >
> >
>
>

Re: is jackrabbit Threadsafe?

Posted by Ted Roeloffzen <te...@gmail.com>.
So we don't have to create a variable for the JackRabbit session in the
HTTP-session, but we can use it in a request-cycle?? We are now using a
simple Abstract class en getting the session from it.



On 10/16/06, Alexandru Popescu <th...@gmail.com> wrote:
>
> On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > So when using it in a Web-application, every HTTP-session has to have
> its
> > own JackRabbit-session. So then it would be threadsafe?
> >
> >
>
> I think you should think about it in request-scope and not on Http
> session scope. Only request-response cycles are guaranteed to happen
> on the same thread.
>
> ./alex
> --
> .w( the_mindstorm )p.
>
> > On 10/16/06, Tobias Bocanegra <to...@day.com> wrote:
> > >
> > > if every thread uses it's own jcr session, yes.
> > > regards, toby
> > >
> > > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > > I would really like to know if JackRabbit is threadsafe.
> > > >
> > > > Greets,
> > > >
> > > > Ted
> > > >
> > > >
> > >
> > >
> > > --
> > > -----------------------------------------< tobias.bocanegra@day.com>---
> > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
> Basel
> > > T +41 61 226 98 98, F +41 61 226 98 97
> > > -----------------------------------------------< http://www.day.com>---
> > >
> >
> >
>

Re: is jackrabbit Threadsafe?

Posted by Alexandru Popescu <th...@gmail.com>.
On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> So when using it in a Web-application, every HTTP-session has to have its
> own JackRabbit-session. So then it would be threadsafe?
>
>

I think you should think about it in request-scope and not on Http
session scope. Only request-response cycles are guaranteed to happen
on the same thread.

./alex
--
.w( the_mindstorm )p.

> On 10/16/06, Tobias Bocanegra <to...@day.com> wrote:
> >
> > if every thread uses it's own jcr session, yes.
> > regards, toby
> >
> > On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > > I would really like to know if JackRabbit is threadsafe.
> > >
> > > Greets,
> > >
> > > Ted
> > >
> > >
> >
> >
> > --
> > -----------------------------------------< tobias.bocanegra@day.com >---
> > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> > T +41 61 226 98 98, F +41 61 226 98 97
> > -----------------------------------------------< http://www.day.com >---
> >
>
>

Re: is jackrabbit Threadsafe?

Posted by Ted Roeloffzen <te...@gmail.com>.
So when using it in a Web-application, every HTTP-session has to have its
own JackRabbit-session. So then it would be threadsafe?


On 10/16/06, Tobias Bocanegra <to...@day.com> wrote:
>
> if every thread uses it's own jcr session, yes.
> regards, toby
>
> On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> > I would really like to know if JackRabbit is threadsafe.
> >
> > Greets,
> >
> > Ted
> >
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>

Re: is jackrabbit Threadsafe?

Posted by Tobias Bocanegra <to...@day.com>.
if every thread uses it's own jcr session, yes.
regards, toby

On 10/16/06, Ted Roeloffzen <te...@gmail.com> wrote:
> I would really like to know if JackRabbit is threadsafe.
>
> Greets,
>
> Ted
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---