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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to