zoukankan      html  css  js  c++  java
  • current transaction is aborted, commands ignored until end of transaction block

    current transaction is aborted, commands ignored until end of transaction block

    Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: syntax error at or near "where"
    Position: 36
    ### The error may involve com.project.mapper.PProjectLedgerMapper.updateByPrimaryKeySelective-Inline
    ### The error occurred while setting parameters
    ### SQL: update p_project_ledger where id = ?
    ### Cause: org.postgresql.util.PSQLException: ERROR: syntax error at or near "where"
    Position: 36
    ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near "where"

    整个事务中,有SQL编译失败,导致整个事务被放弃中止。
    据说此异常捕获无效,是数据库层面的一种机制。

    起因是更新字段时,有更新字段值为空,使用updateByPrimaryKeySelective时,自动过滤掉空字段,导致数据库层面编译错误。

    使用数据库 postgreSQL

  • 相关阅读:
    分组背包(课题选择)
    和为n的俩个数的最大lcm
    合唱队形(悬线法)
    郊区春游(状压dp)
    三角形最大周长
    取余妹子数
    树形dp旅游
    L1-033 出生年
    L1-043 阅览室
    L1-044. 稳赢
  • 原文地址:https://www.cnblogs.com/yeyuchangfeng/p/10913816.html
Copyright © 2011-2022 走看看