程序调时问题 返回

SqlSugar 沟通中
4 818

a54df569-6226-4fbc-980e-45f30374a120.png

调试代码,达梦数据库查看实例报错,金仓和Mysql 没这问题 VS2022

热忱回答(4)

  • fate sta fate sta VIP0
    2025/12/28

    忽略就行了。get会调试中强制执行。 代码不会。

    0 回复
  • 玄弦 玄弦 VIP0
    2025/12/29

    但特别奇怪人大金仓和mysql走这同一套代码没事 就达梦不行。

    现在有个新问题人大金仓插入的时间总差8小时,

    public virtual async Task<bool> UpdateAsync(T entity, CancellationToken cancellationToken = default)

    {

        try

        {

            var rows = await _db.Updateable(entity)

                .ExecuteCommandAsync(cancellationToken);

            _logger.LogDebug("更新 {EntityType},ID: {Id},影响行数: {Rows}",

                typeof(T).Name, GetEntityId(entity), rows);

            return rows > 0;

        }

        catch (Exception ex)

        {

            _logger.LogError(ex, "更新 {EntityType} 失败", typeof(T).Name);

            throw;

        }

    }

    连接串加了TimeZone=Asia/Shanghai 金仓数据库配置文件 改了 timezone = 'Asia/Shanghai'  log_timezone = 'Asia/Shanghai' 数据库字段分别用了timestamp with time zone和 timestamp 执行之前 看了entity里时间字段的kind类型 是local 进数据库就差8小时这是因为啥,得怎么解决


    0 回复
  • 玄弦 玄弦 VIP0
    2025/12/29

    @fate sta:

    但特别奇怪人大金仓和mysql走这同一套代码没事 就达梦不行。

    现在有个新问题人大金仓插入的时间总差8小时,

    public virtual async Task<bool> UpdateAsync(T entity, CancellationToken cancellationToken = default)

    {

        try

        {

            var rows = await _db.Updateable(entity)

                .ExecuteCommandAsync(cancellationToken);

            _logger.LogDebug("更新 {EntityType},ID: {Id},影响行数: {Rows}",

                typeof(T).Name, GetEntityId(entity), rows);

            return rows > 0;

        }

        catch (Exception ex)

        {

            _logger.LogError(ex, "更新 {EntityType} 失败", typeof(T).Name);

            throw;

        }

    }


    0 回复
  • 玄弦 玄弦 VIP0
    2025/12/29

    @fate sta:

    但特别奇怪人大金仓和mysql走这同一套代码没事 就达梦不行。

    现在有个新问题人大金仓插入的时间总差8小时,

    public virtual async Task<bool> UpdateAsync(T entity, CancellationToken cancellationToken = default)

    {

        try

        {

            var rows = await _db.Updateable(entity)

                .ExecuteCommandAsync(cancellationToken);

            _logger.LogDebug("更新 {EntityType},ID: {Id},影响行数: {Rows}",

                typeof(T).Name, GetEntityId(entity), rows);

            return rows > 0;

        }

        catch (Exception ex)

        {

            _logger.LogError(ex, "更新 {EntityType} 失败", typeof(T).Name);

            throw;

        }

    }

    连接串加了TimeZone=Asia/Shanghai 金仓数据库配置文件 改了 timezone = 'Asia/Shanghai'  log_timezone = 'Asia/Shanghai' 数据库字段分别用了timestamp with time zone和 timestamp 执行之前 看了entity里时间字段的kind类型 是local 进数据库就差8小时这是因为啥,得怎么解决


    0 回复