navicat中執行PostgreSQL錯誤解決:ERROR: current transaction is aborted, commands ignored until end of transa

錯誤出現:sql

含有錯誤的查詢後,選中insert語句沒法執行,報錯current transaction is aborted, commands ignored until end of transaction block事務

分析:get

事務中含有錯誤,再執行DML時,事務沒法正常進行。it

解決方法:io

1.嘗試connection.setAutoCommit(true);沒法執行exception

2.直接commit ,提交後再執行insert語句,成功插入。command

 

參考了stackoverflow的解法:方法

https://stackoverflow.com/questions/10399727/psqlexception-current-transaction-is-aborted-commands-ignored-until-end-of-trastackoverflow

相關文章
相關標籤/搜索