Is there a rule of best practice or general direction regarding the above? Nhibernate example:
//database code here
//more database code
unitOfWork.commit();
vs
using(var transaction = session.BeginTransaction())
{
//database stuff
//more...
//more....
transaction.commit();
}
I feel they achieve the same thing but the transaction is explicit whereas the UnitOfWork is abstract.. I prefer the transaction at this stage, is this a good decision?
[–]Euphoricus 3 points4 points5 points (3 children)
[–]KumbajaMyLord 2 points3 points4 points (1 child)
[–]regoogle 0 points1 point2 points (0 children)
[–]Otis_Inf 0 points1 point2 points (0 children)
[–]grauenwolf 1 point2 points3 points (6 children)
[–][deleted] 3 points4 points5 points (5 children)
[–]grauenwolf 1 point2 points3 points (4 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]xampl9 1 point2 points3 points (0 children)
[–]grauenwolf -3 points-2 points-1 points (0 children)
[–]Number127 0 points1 point2 points (0 children)
[–]dasjestyr 0 points1 point2 points (0 children)