Reputation: 967
In my c++ program, I'm having problems with my program where I am running too many things through the database at once and am getting an error. How can I fix this?
Upvotes: 0
Views: 40
Reputation: 5470
Given that you have updated your code with server side code. Here's one way you can resolve your dead lock.
First you need to understand by default Entity framework isolation level for transaction is Serializable. Here's some more information on SQL server Isolation levels.
It states that for Serializable:
So what you need to do is change your EF transaction scope isolation level to snapshot example:
using (var scope = new TransactionScope(TransactionScopeOption.Required, new
TransactionOptions { IsolationLevel= IsolationLevel.Snapshot }))
{
// do something with EF here
scope.Complete();
}
Upvotes: 2
Reputation: 657308
recordPayroll(): void {
return Observable.of(this.ptoData).mergeMap(ptoDataItem => {
if (this.ptoDataItem.date < this.date && this.ptoDataItem.type != "Uncharged") {
this.ptoDataItem.inPR = true;
return this.ptoDataService.update(this.ptoDataItem);
}
return Observable.empty();
}
}
No guarantees this will work. I don't use TS myself and are not used to RxJS.
Upvotes: 0