public class Repository
{
private readonly UnitOfWork _uow;
public Repository()
{
_uow = new UnitOfWork();
}
public void InsertSummary(List<string> knownModel,int batchid,int personid,int submittingorgid)
{
foreach (var src in knownModel)
{
_uow.SummaryRepo.Insert(new SIFUploadSummary
{
SessionId = SessionId,
BatchId = batchId,
rIFObject = src,
SuccessCount = 0,
PCount = 0,
CCount = 0,
CECount=0,
DCount = 0,
ECount = 0,
PersonId = personId,
OrganizationId = submittingOrgId,
Status = 1
LoginId = userName,
CreateDate = DateTime.Now
});
}
_uow.SummaryRepo.Save();//here i am getting above error.
}
}
while inserting records in table with above code i am getting following exception
An error was reported while committing a database transaction but it could not be determined whether the transaction succeeded or failed on the database server. See the inner exception and http://go.microsoft.com/fwlink/?LinkId=313468 for more information.The transaction operation cannot be performed because there are pending requests working on this transaction.
How to handle this exception please help me. this error occurs sometimes not regularly.
here can we use CommitFailureHandler of entity frame work then how to use here i am using unit of work repository.