How are you obtaining the ISession in the first place, and how are you 
binding it to the ISessionFactory?

RP

On Wednesday, June 10, 2015 at 8:37:24 PM UTC+1, Felipe Oriani wrote:
>
> Hi,
>
> I am working in a project, where the ISession is being binding in the 
> ISessionFactory, so, I can access it using the 
> sessionFactory.GetCurrentSession() method. In my scenario, the customer 
> will config a sql query to be execute to get some value from the database. 
> I use this value to persist another entity.
>
> var session = _sessionFactory.GetCurrentSession(); 
>
> var value = _session.CreateSQLQuery(sqlCustomer).List();
> /* query execute fine and I get the result to persist another object */
>
> _session.Save(entity);
>
> The problem is when I try to Save another object, I get an exception 
> saying that the ExecuteReader cannot be executed because the connection is 
> closed.
>
> If I remove the call of CreateSQLQuery, it works fine. Does anybody knows, 
> how can I fix it to keep the connection open?
>
> Thank you.
>
>
> -- 
> ______________________________________
> Felipe B Oriani
> [email protected] <javascript:>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to