On Fri, Nov 20, 2009 at 19:27, Phukan, Anit <[email protected]> wrote:
> Could you please let me know if there is a good way to create a new
> repository session for each incoming web service request?
>
> I have created a long running session in a static initializer, but sessions
> are not thread safe and may get corrupted over a period of time with
> multiple concurrent hits.
>
> I would appreciate your thoughts on this.

If you use j2ee, you can easily have a ServletFilter that will create
the session and add it to the servlet attributes for use in your
request handling servlets. Or take a look at Apache Sling [1], which
does that (and much more) automatically for you. For general thoughts
on sessions in the context of web apps, see also [2].

[1] http://sling.apache.org
[2] http://wiki.apache.org/jackrabbit/JcrSessionHandling

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to