You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dan Adams <da...@ifactory.com> on 2006/01/27 21:48:35 UTC

ASO's and hibernate sessions

Okay, I'm using session-per-request with hibernate and in my aso I have
an object that associates the user with a school. Does anyone know of a
good way of re-associating the school with the current session on each
request or making sure it's in the session?

-- 
Dan Adams
Software Engineer
Interactive Factory


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: ASO's and hibernate sessions

Posted by Leonardo Quijano Vincenzi <le...@dtqsoftware.com>.
Dan Adams wrote:
> Okay, I'm using session-per-request with hibernate and in my aso I have
> an object that associates the user with a school. Does anyone know of a
> good way of re-associating the school with the current session on each
> request or making sure it's in the session?
>
>   
If your school has some collections in it or something like that, 
associating it with a session-per-request doesn't work properly. 
Hibernate is very picky when you move a proxied or lazy initialized 
object from one session to another, and usually recommends to use a 
session-per-application-transaction pattern for that.

You can always use session.lock() to reassociate the object. But it's a 
can of worms. Don't go there (that's my own bad experience talking).

-- 
Ing. Leonardo Quijano Vincenzi
DTQ Software



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: ASO's and hibernate sessions

Posted by Sven Homburg <Sv...@hsofttec.com>.
Am Friday 27 January 2006 21:48 schrieb Dan Adams:
> Okay, I'm using session-per-request with hibernate and in my aso I have
> an object that associates the user with a school. Does anyone know of a
> good way of re-associating the school with the current session on each
> request or making sure it's in the session?
> 

how do you realized that?
my problem is to use the hibernate session in an IBasicTableModel-class

-- 
with best regards

homburg Softwaretechnik
S.Homburg
21220 Seevetal / GERMANY
Fon: +49-4105-669746
Fax: +49-4105-668947

-= Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, 
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rich Cook =-

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org