setReadOnly does not work with pgbouncer and transaction pooling mode
See original GitHub issueCurrently setReadOnly change mode for all session, not for transaction. It breaks work through pgbouncer in transaction pooling mode.
Can this be changed? For example like in psycopg2 python driver, see: https://github.com/psycopg/psycopg2/blob/2_7_1/psycopg/pqpath.c#L504
psycopg2 can set read only as part of BEGIN clause, like:
BEGIN READ ONLY;
this work perfectly over pgbouncer in transaction pooling mode too.
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (13 by maintainers)
Top Results From Across the Web
Readonly connections occasionally being used as writeable ...
1, and since 1.7, PgBouncer only runs its server_reset_query for connection pools using the "session"-level pooling mode, not "transaction"- ...
Read more >setReadOnly not working on PostgreSQL Connection
Problem seems related to a bug of the driver. These two workaround both worked for me: proposed by kayaman: executing first the sql...
Read more >PgBouncer config
Connections in transaction-pooling mode should not have any need for a reset query. This setting is for working around broken setups that run...
Read more >PgBouncer and 20,000 TPS on one node | Manualzz
advanced tuning, hacks and problem solving ... What doesn't work in PgBouncer ... setReadOnly does not work with pgbouncer and transaction pooling mode....
Read more >The connection class — Psycopg 2.9.5 documentation
The connection can be also set in “autocommit” mode: no transaction is ... To avoid this problem you can ensure to terminate the...
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 Free
Top 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
Hi Dave, Thank you very much for answer. I guess this issue is now fixed from 42.2.10 right ?
How can I ignore the read-only transaction with the new feature implemented? I see the PGProperty class but don’t know how to set them on my spring boot application.
Thank you again.
@davecramer please find the PR for documentation fix.