Jim,

I have vague recollections of hitting this before.

IIRC, each hibernate object knows the Session that it is associated with.
 So, if an object is associated with Session A on Thread A, and you modify
that object from Thread B, then Session A now has to manage changes made
from a different thread, which presents lots of challenges.

So, I think it's not so much about your handling of the Sessions, as it is
about handling session-managed objects that get accessed from different
threads.

Can you detach your objects before allowing other threads to access them?

Regards,

Jonathan


On Wed, Jul 21, 2010 at 1:29 PM, Jim O'Callaghan <jc1000...@yahoo.co.uk>wrote:

> Yep Thiago, it's Tapestry-Hibernate creating the sessions.  My situation
> might be a little contrived, but I'm concerned  it might happen to
> end-users, as I don't fully understand why it's happening.
>
> Regards,
> Jim.
>
> -----Original Message-----
> From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com]
> Sent: 21 July 2010 18:22
> To: Tapestry users
> Subject: Re: non thread safe access to session
>
> On Wed, 21 Jul 2010 13:58:15 -0300, Jim O'Callaghan
> <jc1000...@yahoo.co.uk> wrote:
>
> > Hi Thiago,
>
> Hi, Jim!
>
> > I'm talking about the hibernate session - I'm injecting it into the
> > constructor of Service B at bind time.  I thought Tapestry would treat
> > the service as a thread safe singleton and control access to method
> > calls on it accordingly?
>
> Tapestry-IoC doesn't synchronize method calls. How are you building the
> sessions? Tapestry-Hibernate?
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informa��o Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Jonathan Barker
ITStrategic

Reply via email to