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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM