Language: C#
Bad NHibernate Transaction usage
public IQueryable<T> Query(Expression<Func<T, bool>> predicate) { IQueryable<T> returnValue; using (ITransaction transaction = _session.BeginTransaction()) { try { returnValue = _session.Linq<T>().Where(predicate); transaction.Commit(); } catch (Exception ex) { transaction.Rollback(); Log.Error(this,ex.Message,ex); throw; } } return returnValue; }
Tags:
Description:
At some point transactions were added to this code. Pretty sure they are completely useless at this point.
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

