-->
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: Unique object in Session
PostPosted: Tue Sep 25, 2007 6:24 pm 
Newbie

Joined: Sun Nov 05, 2006 10:19 am
Posts: 13
Hi,

I'm working on a project using ASP.NET 2.0 and NH. Many times I'm keeping in http session detached object from NH session.

Sometimes I receive the error:

Quote:
a different object with the same identifier value was already associated with the session


Is there any way to find out if an object is in NH session? If I'm making a Get method if it's not in the session it will be get from database? I just want to check if it's in the session; If not i want to attach it.

Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 26, 2007 3:30 am 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
Try Session.Contains(object).

Cheers,

Symon.


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.