-->
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.  [ 3 posts ] 
Author Message
 Post subject: What exactly is "ISession exception"
PostPosted: Mon Feb 19, 2007 4:45 am 
Beginner
Beginner

Joined: Mon Feb 19, 2007 4:22 am
Posts: 22
Location: Poland
One can read in the NHibernate manual:

Quote:
If the ISession throws an exception you should immediately rollback the transaction, call ISession.Close() and discard the ISession instance. Certain methods of ISession will not leave the session in a consistent state.


Now, my question is as in the topic: what is the ISession exception exactly? How do I distinguish it from other NHibernate exceptions that probably do not need session dismission.

For example if I catch NHibernate.ADOException do I have to close the current session or can I just handle this exception according to my needs and keep on doing my job without closing everything?

Thanks in advance,
Marcin


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 19, 2007 5:01 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
There is no such thing as "the ISession exception". If a session throws any exception (including ADOException), you should close and discard it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 19, 2007 5:06 am 
Beginner
Beginner

Joined: Mon Feb 19, 2007 4:22 am
Posts: 22
Location: Poland
That wasn't clear for me. Now it is. Thank you.

Case closed as for me.

Marcin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.