Does this (not CRUD, but only Read) code require me to write transaction management?
ICriteria criteria = SessionFactory.GetCurrentSession().CreateCriteria(EntityType);
criteria.List<BaseEntity>();
Does this (not CRUD, but only Read) code require me to write transaction management?
ICriteria criteria = SessionFactory.GetCurrentSession().CreateCriteria(EntityType);
criteria.List<BaseEntity>();
I cannot say that I do it always, But I would say that this question is pretty reasonable. As you can Transactions for read-only DB access? what we can get is:
And as mentioned here: NHibernate Transactions on Reads (small extract)
So, in general, if you have common way (e.g. Web request handling with AOP) it could be useful