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