We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql8.1+windows10环境下 某个控制器内部业务为更新两个表AB,外层方法更新A表,内层方法为异步更新B表,异步方法里面,更新了B表后,会导致外层事务的Tanscation失效。 public async Task MethodA() { using (var tran = Log.Meta.CreateTrans())//表A事务开始 { await MethodB();//更新表B tran .Commit();//提交报事务未开始异常。 } } 改为如下正常使用: public async Task MethodA() { using (var tran = Log.Meta.CreateTrans()) { MethodB().GetAwaiter().GetResult(); tran .Commit();//提交事务正常。 } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
mysql8.1+windows10环境下
某个控制器内部业务为更新两个表AB,外层方法更新A表,内层方法为异步更新B表,异步方法里面,更新了B表后,会导致外层事务的Tanscation失效。
public async Task MethodA()
{
using (var tran = Log.Meta.CreateTrans())//表A事务开始
{
await MethodB();//更新表B
tran .Commit();//提交报事务未开始异常。
}
}
改为如下正常使用:
public async Task MethodA()
{
using (var tran = Log.Meta.CreateTrans())
{
MethodB().GetAwaiter().GetResult();
tran .Commit();//提交事务正常。
}
}
The text was updated successfully, but these errors were encountered: