-->
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: OpenSession connects immediatly?
PostPosted: Fri Jan 11, 2008 12:31 pm 
Beginner
Beginner

Joined: Tue Mar 27, 2007 4:54 am
Posts: 47
Hibernate version:
1.2

Reading the docs get me the impression that an ISession isn't suppose to open a database connection when created but when first used. From the docs...
"The legacy (1.0.x) behavior of NHibernate in regards to ADO.NET connection management was that a ISession would obtain a connection when it was first needed and then hold unto that connection until the session was closed. NHibernate 1.2 introduced the notion of connection release modes to tell a session how to handle its ADO.NET connections."

However, when creating a session ([IUnitOfWorkFactory].OpenSession()], it seems to defaults to an open connection (IsConnected property returns true).

Have I misunderstood the documentation? Or isn't just the releasing of the connection but also the creation of it that changed in version 1.2? Or, maybe, is the IsConnected not returning the right result until the first query to the data source?

Regards
Roger


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.