-->
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.  [ 1 post ] 
Author Message
 Post subject: when to open/clear/close session
PostPosted: Sun Dec 11, 2011 11:17 pm 
Newbie

Joined: Sun Dec 11, 2011 11:01 pm
Posts: 1
hi..
I am newbie of nhibernate.
I build winform application using Nhibernate which has add/delete/edit/retrieve process, but I am not understand when to open session or close session or clear session.

I used open session on event Load Form and close when I unload form. but the effect ever time I retrieve data I should clear session first and then retrieved because if I did not clear session, system will retrieve not live data(after I updated or add new).


but I got example on google.they put open session and close session on process/function. like:
public sub retrieved_all()
Dim sessionfactory As ISessionFactory = New Configuration().Configure().BuildSessionFactory
session = sessionfactory.OpenSession
'....retrieved process
session.close()
end sub


could everyone help me when to use open/clear and close session

thanks for your helping


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

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.