数据库有问题
Having problems with database
在我的 c++ 程序中,我的程序遇到了问题,我一次通过数据库运行太多东西并收到错误。我该如何解决这个问题?
假设您已经使用服务器端代码更新了代码。这是解决死锁的一种方法。
首先,您需要了解默认情况下事务的实体框架隔离级别是可序列化的。下面是有关 SQL 服务器隔离级别的详细信息。
它指出,对于可序列化:
- 在当前事务完成之前,任何其他事务都不能修改当前事务已读取的数据。
因此,您需要做的是将 EF 事务范围隔离级别更改为快照示例:
using (var scope = new TransactionScope(TransactionScopeOption.Required, new
TransactionOptions { IsolationLevel= IsolationLevel.Snapshot }))
{
// do something with EF here
scope.Complete();
}
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();
}
}
不能保证这会起作用。我自己不使用 TS,也不习惯 RxJS。
相关文章:
- 我似乎对if/else的基本语句有问题:/
- 我在范围内未声明的错误类有问题
- 我的C++语言蛮力算法有问题
- 我关于函数"Assert"的C++代码有问题
- 标准对此指向成员函数类型模板参数有何说明?是我的代码有误,还是 MSVS 16.6 有问题?
- C++类中的友元函数有问题?
- 我对数组即 0x6dfe78 有问题
- 我对 std::unique(算法)C++有问题
- 使用 fstream 库并在屏幕上打印的文件有问题?
- 这个模板为什么有问题?如何正确编译
- 我对 MyGraph 属性顶点名称和边权重有问题
- delete[]有问题,如何部分删除内存
- 在C++中使用exit()退出程序有问题吗
- 跳转到if(false)块有问题吗
- 查找有问题的宏
- 使用 rand() 和 srand() 有问题
- C++ 回文程序总是给出 0(假)作为输出问题;我的代码哪里有问题?
- 我在 C++ "out_of_range at memory location"有问题
- 数据库有问题
- 使用c++在mysql数据库表中插入多个值有问题