The problem must be that you are using request-scoped beans, don't you?

If you use request-scoped beans, then you have to "merge" on every request, using session.merge ;-)

There was a discussion about this issue at the beginning of February:

http://marc.theaimsgroup.com/?l=myfaces-user&m=113890037426173&w=2

I would recommend using either session-scoped beans, or a session state container, accesible to all your beans, where the current object being worked is available.

2006/3/1, Sebastien Boutte <[EMAIL PROTECTED]>:
Hi Aleksei,

In fact, i've just started to have the OpenSessionInFilterView to work.
But now, i've to face different kind of problems.

I can retrieve data from Hibernate using lazy initialisation ie i load
a collection objects, select one, view it (simple master-details view
city-zipcode relation) all tasks in a myfaces webapp.
but when i update one detail and want to save the master i have
a NonUniqueException that is raised.

I've read in the myfaces wiki that you have to reattach all objects to
the session at the beginning of the request. Is it the solution to my
problem (An instance which is loaded in different sessions) ?
How do you do it programmatically ? Do you have a registry of all
hibernate objects used in your application and reattach automatically
all objects at the beginnng of the request ?

Thanks

Sébastien


Reply via email to