Error occurred:
Current transaction is aborted, commands ignored until end of transaction block
analysis:
The transaction contains errors. When the DML is executed again, the transaction cannot proceed normally.
When automatic transaction submission is turned off in PG database, we often encounter such problems
error: Current transaction is aborted, commands ignored until end of transaction block
the reason why this problem is caused is that
in the Postgres database, if an error occurs in a database operation in the same transaction, the database after the transaction will make an error
let’s take a very simple example
test = # select * from test1
ERROR: relation “test1” does not exist
LINE 1: select * from test1;
^
time: 0.376 MS
at this time, because there is no operation error, all subsequent operations in this session will report
error: Current transaction is aborted, commands ignored until end of transaction block
to solve this problem, we can only use rollback or commit
PG is not user-friendly
Solution:
1. Try connection.setautocommit (true); Cannot execute
2. Commit directly, execute the insert statement after submitting, and insert successfully.
Refer to the stackoverflow solution:
postgresql – PSQLException: current transaction is aborted, commands ignored until end of transaction block – Stack Overflow
Read More:
- [Solved] PostgreSQL Error: Could not connect to server: no such file or directory
- Git Push Error: Proxy CONNECT aborted [How to Solve]
- PostgreSQL insert data error: column “XXX” does not exist solution
- [Solved] Connection error with cocoapods. Proxy CONNECT aborted
- The URL is timestamped to avoid caching problems when requesting the current path again
- Tidb2.1 reports Error statement count 5001 exceeded the transaction limit, autocommit = false
- [Solved] eggjs Error: Warning: Current Server Discovery and Monitoring engine is deprecated, and will be rem…
- [Solved] PostgreSQL Remote Access Error: could not connect to server
- [Solved] OpenSSL ssL_read: Connection was aborted,errno 10053
- [Solved] MindSpore Error: task_fail_info or current_graph_ is nullptr
- [Solved] CMake Error: The current CMakeCache.txt directory is different than xxx
- Solution: configuration of multiple front ends separated from front end and back end of nginx
- [Solved] Postgres Start Error: Job for postgresql.service failed because the control process exited with error code.
- VSCode Terminal Execute tsc Commands Error [Solved]
- [Solved] docker Commands Execute Error: Segmentation fault
- How to Fix PVE Issues: ERROR: migration aborted
- VUE Error: Request aborted at createError [How to Solve]
- Unity Error: Asset database transaction committed twice!
- SAP RETAIL Automatic replenishment WRP1R transaction code error: Forecast values for determining target stock do not exist –
- Current request is not a multipart request [How to Solve]