Si vous avez somehting comme ceci:Transactions imbriquées avec TransactionScope
IBinaryAssetStructureRepository rep = new BinaryAssetStructureRepository();
var userDto = new UserDto { id = 3345 };
var dto = new BinaryAssetBranchNodeDto("name", userDto, userDto);
using (var scope1 = new TransactionScope())
{
using(var scope2 = new TransactionScope())
{
//Persist to database
rep.CreateRoot(dto, 1, false);
scope2.Complete();
}
scope1.Dispose();
}
dto = rep.GetByKey(dto.id, -1, false);
Est-ce que la TransactionScope intérieure SCOPE2 également être annulées?
Ce lien est cassé. – adamjford
Vous dites scope.Dispose est redondant, mais surtout scope1.dispose annule la transaction. – Mcanic