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:
- The execution of ExecuteNonQuery by oraclecommand is suspended
- ORA-08103: object no longer exists [How to Solve]
- DB::Exception: test: Authentication failed: [How to Solve]
- Node.js operation mysql error Cannot enqueue Handshake after invoking quit
- [Solved] ora 01033 linux,ORA-01033: ORACLE initialization or shutdown in progres
- Gitlab Reconfigure is Stuck ruby_block[wait for redis service socket] action run
- [Solved] push declined due to email privacy restrictions (GH007 error code)
- [Solved] C++ Error: terminate called after throwing an instance of ‘char const‘
- Git: How to Solve Error: Please commit your changes or stash them before you merge.
- [Solved] SHELL Run Error: “-BASH: ./TEST.SH: /BIN/BASH^M: BAD INTERPRETER: NO SUCH FILE OR DIRECTORY”
- DM backup database Error: [-7169]:bakres failed to communicate with DMAP message.
- [Solved] mongodb Backup Error: Failed: error getting collections for database `admin`: error running `listCollections`
- [Solved] Springboot Connect MongoDB Error: UncategorizedMongoDbException: Command failed with error 13 (Unauthorized)
- [Solved] TDengine Error: Unable to resolve FQDN
- [Solved] Git pull error: cannot pull with rebase: Your index contains uncommitted changes.
- [Solved] 01654 error: the index cannot be extended through 8
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- Pytorch failed to specify GPU resolution
- Oracle18c Error: ORA-12012: error on auto execute of job
- Error using tensorflow GPU: could not create cudnn handle: cudnn_STATUS_NOT_INITIALIZED