Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nhibernate session.BeginTransaction() vs. transaction.Begin()

My question is related to use of nhibernate transactions

Is the transaction.Begin() below a problem? or just redundant?

using (var transaction = session.BeginTransaction())
{
    transaction.Begin();
    action();
    transaction.Commit();
}
like image 400
SteveM Avatar asked May 31 '13 11:05

SteveM


1 Answers

After checking the source, transaction.Begin() is in fact redundant - a harmless no-op.

link to source

like image 72
SteveM Avatar answered Sep 18 '22 12:09

SteveM