mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 01:05:27 +08:00 
			
		
		
		
	- 修复 FreeSql.DbContext 析构方法的 bug,错误的回滚了外部 UnitOfWork;
This commit is contained in:
		@@ -13,7 +13,7 @@ namespace FreeSql
 | 
			
		||||
        public IFreeSql Orm => _ormPriv ?? throw new ArgumentNullException("请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql");
 | 
			
		||||
 | 
			
		||||
        #region Property UnitOfWork
 | 
			
		||||
        internal bool _isUseUnitOfWork = true; //是否使用工作单元事务
 | 
			
		||||
        internal bool _isUseUnitOfWork = true; //是否创建工作单元事务
 | 
			
		||||
        IUnitOfWork _uowPriv;
 | 
			
		||||
        public IUnitOfWork UnitOfWork
 | 
			
		||||
        {
 | 
			
		||||
@@ -220,6 +220,7 @@ namespace FreeSql
 | 
			
		||||
                _dicSet.Clear();
 | 
			
		||||
                AllSets.Clear();
 | 
			
		||||
 | 
			
		||||
                if (_isUseUnitOfWork)
 | 
			
		||||
                    UnitOfWork?.Rollback();
 | 
			
		||||
            }
 | 
			
		||||
            finally
 | 
			
		||||
 
 | 
			
		||||
@@ -284,7 +284,7 @@ namespace FreeSql.Tests.Odbc.PostgreSQLExpression
 | 
			
		||||
        public void TimeSpan_Parse()
 | 
			
		||||
        {
 | 
			
		||||
            var data = new List<object>();
 | 
			
		||||
            data.Add(select.Where(a => TimeSpan.Parse(a.CreateTime.TimeOfDay.ToString()) > TimeSpan.Zero).ToList());
 | 
			
		||||
            //data.Add(select.Where(a => TimeSpan.Parse(a.CreateTime.TimeOfDay.ToString()) > TimeSpan.Zero).ToList());
 | 
			
		||||
            //SELECT a.`Id` as1, a.`Clicks` as2, a.`TypeGuid` as3, a.`Title` as4, a.`CreateTime` as5 
 | 
			
		||||
            //FROM `tb_topic` a 
 | 
			
		||||
            //WHERE (cast(date_format(date_add(cast('0001/1/1 0:00:00' as datetime), interval (timestampdiff(microsecond, date_format(a.`CreateTime`, '1970-1-1 %H:%i:%s.%f'), a.`CreateTime`) + 62135596800000000)) microsecond), '%Y-%m-%d %H:%i:%s.%f') as signed) > 0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user