You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Laurent Eskenazi <le...@mail.inforama.fr> on 2000/03/23 18:38:28 UTC

Cocoon / jserv & Threads

Hi there!

I'm planning to use some static data in Java and I'm particularly concerned
about concurrent access to those data. So, I'd like to have some details
about Cocoon, Jserv and how they use threads.

Are every pages of cocoon generated by a single process using multiple
threads or is there a different VM for each request ? Is there a way to
share ressources like DB connections for these requests ?


Thanks

Laurent


Re: Cocoon / jserv & Threads

Posted by Laurent Eskenazi <le...@mail.inforama.fr>.
Thanks Stephano for your answers.

> > Is there a way to
> > share ressources like DB connections for these requests ?
>
> Of course, place it into your session, or into your servlet context.

That's it. I'd prefer to put these in my servlet context, but how can I do
this when using cocoon with XML/XSP pages ? Is there a way of using Jserv's
servlets' Init() and destroy() method when using such pages ? How ?

> Hmmmm, anyway, please, move all the servlet-related issues on
> jserv-users, these have nothing to do with Cocoon.

OK. I apologize...i won't do it again =+)

Thanks for your help !

Laurent


Re: Cocoon / jserv & Threads

Posted by Stefano Mazzocchi <st...@apache.org>.
Laurent Eskenazi wrote:
> 
> Hi there!
> 
> I'm planning to use some static data in Java and I'm particularly concerned
> about concurrent access to those data. So, I'd like to have some details
> about Cocoon, Jserv and how they use threads.
> 
> Are every pages of cocoon generated by a single process using multiple
> threads or is there a different VM for each request ? 

are you kidding? a different VM for each request? that would kill you.

One thread per request. You can even recycle the threads on JServ (I
even wrote that thread pool)

> Is there a way to
> share ressources like DB connections for these requests ?

Of course, place it into your session, or into your servlet context.
Hmmmm, anyway, please, move all the servlet-related issues on
jserv-users, these have nothing to do with Cocoon.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------