-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: maintain NHibernate object in ASP.Net Session
PostPosted: Sat Mar 14, 2009 5:03 am 
Newbie

Joined: Sat Mar 14, 2009 4:48 am
Posts: 1
NHibernate version:2.0.1.4000

i retrieve object from DB using NHibernate then keep updating it in ASP.Net session through many postbacks (like wizard steps)
and final when i try to save it i got the following error

Illegal attempt to associate a collection with 2 open session
how can i work around this error ?


Top
 Profile  
 
 Post subject: Have you tried a transient object?
PostPosted: Tue Mar 17, 2009 6:23 pm 
Newbie

Joined: Mon Mar 16, 2009 10:51 pm
Posts: 3
Location: Atlanta
something like this:

object myClass = blahblah.load/select/whatever

object myTransientClass = new object()

(marshall values from myclass -> mytransientclass)

store mytransientclass in session/cache/etc

Upon confirmation, grab myClass from the persistent store, update with the transient values, then flush the session?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.