Hello,
I have deployed my application on 3 tier environment: front-end, back-end, and database server, my problem between the back-end and the database server is it does not roll back all changes (e.g: _requestRepository does not roll back when _fileRepository failed) although I am using unitOfWorkManager:
var options = new UnitOfWorkOptions();
options.AsyncFlowOption = System.Transactions.TransactionScopeAsyncFlowOption.Enabled;
using (var unitOfWork = _unitOfWorkManager.Begin(options))
{
var reqId = await _requestRepository.InsertAndGetIdAsync(req);
foreach (NewFileInput fileInput in moiReq.Files)
{
var f = new UploadedFile
{
File = new File
{
ContentBase64 = fileInput.ContentBase64
},
Type = (int)FileType.AtCreation,
Desc = fileInput.Desc,
FileName = fileInput.FileName,
MimeType = fileInput.MimeType,
RequestId = req.Id,
TransactionId = req.Transactions[0].Id
};
await _fileRepository.InsertAsync(f);
}
unitOfWork.Complete();
Logger.InfoFormat("Request Created Successfully, ReqId:{0}", reqId);
.....
also I tried with sync and did not work, I appreciate your support to figure out where the problem?
Note: DTC is configured and working fine between the two servers :shock: . Also Note: it works and rolled back successfully if the back-end and database on same machine :( .
Thanks, Khaled