You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joshua Jackson <jo...@gmail.com> on 2008/02/29 07:15:37 UTC

T5: Persisting object from ApplicationState

Dear all,

I have annotated an object with @ApplicationState. On the next page, I
persist that object with Hibernate. But it turns out it throw this
exception.

org.hibernate.HibernateException: Illegal attempt to associate a
collection with two open sessions

I am using Tapestry 5.0.11-SNAPSHOT.

Has anyone face this problem before?

Thanks in advance.
-- 
Let's show the world what we've got.

Blog: http://joshuajava.wordpress.com/

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


Re: T5: Persisting object from ApplicationState

Posted by Joshua Jackson <jo...@gmail.com>.
On 2/29/08, Davor Hrg <hr...@gmail.com> wrote:
> that is expected behavior,
> if you persist hibernate objects across requests errors like that will occur
> you can try session.merge(obj);
> it is recommended to handle it differently
>

Yes you're right. Silly me that didn't know about this Hibernate
behaviour. Thanks Davor. :)

Cheers,

--
Let's show the world what we've got.
Blog: http://joshuajava.wordpress.com/

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


Re: T5: Persisting object from ApplicationState

Posted by Davor Hrg <hr...@gmail.com>.
that is expected behavior,
if you persist hibernate objects across requests errors like that will occur
you can try session.merge(obj);
it is recommended to handle it differently

Davor Hrg


On Fri, Feb 29, 2008 at 7:15 AM, Joshua Jackson <jo...@gmail.com> wrote:
> Dear all,
>
>  I have annotated an object with @ApplicationState. On the next page, I
>  persist that object with Hibernate. But it turns out it throw this
>  exception.
>
>  org.hibernate.HibernateException: Illegal attempt to associate a
>  collection with two open sessions
>
>  I am using Tapestry 5.0.11-SNAPSHOT.
>
>  Has anyone face this problem before?
>
>  Thanks in advance.
>  --
>  Let's show the world what we've got.
>
>  Blog: http://joshuajava.wordpress.com/
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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