- 修复 Insert/Update 大批量操作分批执行时,如果外部使用了 Ado.Transaction,没有使用线程事务对象,而是创建了新事务的 bug;

This commit is contained in:
28810
2019-07-04 14:13:15 +08:00
parent b04a4e7266
commit 619c57c254
12 changed files with 40 additions and 10 deletions

View File

@ -132,6 +132,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -180,6 +183,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -228,6 +234,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -278,6 +287,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -328,6 +340,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -376,6 +391,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)

View File

@ -132,6 +132,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -175,6 +178,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -218,6 +224,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)
@ -261,6 +270,9 @@ namespace FreeSql.Internal.CommonProvider
ClearData();
return ret;
}
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction != null)
{
for (var a = 0; a < ss.Length; a++)