If you are using NH session API NH open & close the connection ASAP.If you
get the connection from the session NH give you always an opened connection
and you must take care about what you are doing before and after get that
connection, before and after begin transaction with that connection and
before and after open a DataReader with that connection.
In practices is better if you use session.CreateSQLQuery or
IQuery.ExecuteUpdate instead use the connection of the session.

2008/10/1 Joe <[EMAIL PROTECTED]>

>
> I am trying to understand how NH handles the actual ADO.NET
> connection.
>
> For example, when I request ISession.Connection, I get an OPEN
> IDbConnection. The connection appears to stay open until
> ISession.Close is called.
>
> Is this the expected behavior? I was trying to use the ADO connection
> provided by NH and was surprised to find it already opened. I was
> expecting to have to open and close the connection.
>
> If I need to use the connection from ISession, should I not worry
> about opening and closing it?
>
> Thanks,
> Joe
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to