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


錯誤出現:

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

分析:

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

解決方法:

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

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

 

參考了stackoverflow的解法:

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM