Hello there,
I am new to Nhibernate, so my query may seem trivial to you.
We generally embed data operation code inside
using (var session = sessionFactory.OpenSession())
{
using (var transaction = session.BeginTransaction())
{
...Code for CRUD operations
transaction.Commit();
}
}
Because we generally BeginTransaction/Commit/Rollback for saving/updating/deleting data,
I wonder if BeginTransaction() and Commit() are required even if I am retriving data using session.Get(id); or session.CreateCriteria().List();
Please guide.
Thank you!