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