Hey, someone else on our dev team did most of the low level nHibernate work, so I am not exactly sure how it's all supposed to work, any tips would be appreciated. We have had issues with data sessions and multiple threads in the past, so I know he did a lot of tweaking.
anyway, when I use CreateSQLQuery to do direct SQL query, it locks up the app - not immediately, but eventually - I think next time a query is made. Here is my code:
// Note, the sql query can be a long query with multiple joins...
var query = _dataContext.Session.CreateSQLQuery(sql); query.AddEntity("Studies", typeof (Study)); query.SetCacheMode(CacheMode.Refresh); var results = query.List<TEntity>(); return results.Cast<TEntity>().ToList();
If I close the session immediately, it seems to work ok, but then in other areas in our app I get a Session Closed exception.... ?
Any ideas? I know it's kind of hard withuot knowing our full architecture, but if any one has anything to look out for, that would be great.
thanks,
dan
|