Idle in transaction
See original GitHub issueHello, Database: postgresql 10
Yesterday I noticed, DBeaver leaves its internal queries in “idle in transaction” state. In this particular case those queries lasts for hours (until spotted by maintenance guys).
Here are queries mentioned queries:
SELECT e.typdelim FROM pg_catalog.pg_type t, pg_catalog.pg_type e WHERE t.oid = $1 and t.typelem = e.oid
SHOW search_path
Yesterday I was able to reproduce this issue using my home computer and DBeaver running on Windows10. It was caused by selecting database from Navigator, and clicking CTRL+] to open new tab connected to selected DB.
Unfortunately today I’m not able to reproduce it using Dbeaver running on Ubuntu (in both cases most recent version 7.0.1)
I’m going to check it at home again.
Anyway this is something which should not happen ever. So it’s very important to fix it.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:20 (7 by maintainers)
Top Results From Across the Web
What does it mean when a PostgreSQL process is "idle in ...
The PostgreSQL manual indicates that this means the transaction is open (inside BEGIN) and idle. It's most likely a user connected using the...
Read more >SELECT 1 - idle in transaction - DBA Stack Exchange
idle in transaction means pretty much what it suggests: there is an open transaction doing nothing at the moment.
Read more >Idle Transactions - pganalyze
Detects transactions that have been open with no activity (the idle in transaction state) for longer than the specified threshold of 1800 seconds...
Read more >Avoiding idle-in-transaction connection states with SQLAlchemy
This state is known as an idle-in-transaction connection state and should be avoided as much as possible, because it blocks DB resources without ......
Read more >How to Monitor PostgreSQL Connections - EDB
idle in transaction: This indicates the backend is in a transaction, but it is currently not doing anything and could be waiting for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I cannot decide about this too since I’m not the author of this application. The crucial message is: leaving session in idle in transaction state is considered unacceptable. A lot of properly configured systems is configured to kill such hanging connections after some short period of time. I’m not sure it does any good to DBeaver and user experience though.
I have two ideas:
The point is that in current state, DBeaver opens transaction for meta data (so in the background) and leaves it opened even if no transaction has been opened by a user. The user cannot expect to commit something which is not opened by him.
with regards
+1 this is a dangerous situation; I’ve had to apologize to our production team because my “Idle in transaction” process stalled a nightly import operation.
Ironically, because I wanted the protection of manually committing update transactions.
I like @michalk-k 's suggestions for fixes. And this is exactly correct: “The user cannot expect to commit something which is not opened by him.”
How about: