From: | Thomas Kellerer <shammat(at)gmx(dot)net> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: DBeaver session populating pg_stat_activity.backend_xmin |
Date: | 2023-01-25 19:56:45 |
Message-ID: | e2ee1240-016d-14db-ebe7-7aa03d9d1e12@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Dirschel, Steve schrieb am 25.01.2023 um 20:36:
> When I connect to the database through DBeaver with those 2 default
> settings changed and find that session in pg_stat_activity column
> xact_start is populated along with backend_xmin. Those get
> populated just by logging in.
As you found out in the log, the driver runs DbEaver run multiple SQL statements during the "log in".
And the first query will start a transaction, but as autocommit is disabled, nothing will end
that transaction.
> The problem is users will connect using DBeaver and their sessions
> will sit idle.
Idle is not a problem, "idle in transaction" is.
> It executes the exact same commands except when the 2 default
> DBeaver settings are changed to show the issue it is issuing a BEGIN
> and COMMIT around one block of code and then at another part of code
> it issues a BEGIN, runs some queries, and never issues a COMMIT.
Yes, that's how turning off autocommit works. As soon as a statement is sent through the JDBC driver, the driver will
send a BEGIN to start the transaction, but the the application (or the user) is responsible to end it through a COMMIT
(or ROLLBACK).
From | Date | Subject | |
---|---|---|---|
Next Message | Dirschel, Steve | 2023-01-25 22:21:14 | RE: [EXT] Re: DBeaver session populating pg_stat_activity.backend_xmin |
Previous Message | Dirschel, Steve | 2023-01-25 19:36:02 | DBeaver session populating pg_stat_activity.backend_xmin |