Skip to content

Commit 191102d

Browse files
committed
- 修复 UnitOfWork ReturnObject 释放 _tran 问题;#2003
1 parent 66d94d0 commit 191102d

File tree

5 files changed

+121
-4
lines changed

5 files changed

+121
-4
lines changed
16 KB
Binary file not shown.
8.65 KB
Binary file not shown.

FreeSql.DbContext/Repository/Repository/DefaultRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace FreeSql
55
{
6-
class DefaultRepository<TEntity, TKey> : BaseRepository<TEntity, TKey> where TEntity : class
6+
public class DefaultRepository<TEntity, TKey> : BaseRepository<TEntity, TKey> where TEntity : class
77
{
88
public DefaultRepository(IFreeSql fsql) : base(fsql) { }
99
public DefaultRepository(IFreeSql fsql, UnitOfWorkManager uowManger) : base(uowManger?.Orm ?? fsql)

FreeSql.DbContext/UnitOfWork/UnitOfWork.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void ReturnObject()
4444
if (string.IsNullOrEmpty(this.Id) == false && DebugBeingUsed.TryRemove(this.Id, out var old))
4545
this.Id = null;
4646

47+
_tran?.Dispose();
4748
_fsql.Ado.MasterPool.Return(_conn);
4849
_tran = null;
4950
_conn = null;

FreeSql/FreeSql.xml

Lines changed: 119 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)