pgjdbc: setReadOnly does not work with pgbouncer and transaction pooling mode
Currently 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.
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 22 (13 by maintainers)
Commits related to this issue
- feat: read only transactions If autocommit is set to false, read only will be set on begin transaction. If autocommit is true, it will continue to be managed at session level. The queries to change s... — committed to bokken/pgjdbc by bokken 6 years ago
- feat: read only transactions (#1252) * feat: read only transactions If autocommit is set to false, read only will be set on begin transaction. If autocommit is true, it will continue to be manag... — committed to pgjdbc/pgjdbc by bokken 5 years ago
- docs: change readOnlyMode on connect.md documentation change the documentation by completing documentation with parameter that didn't exist the change is due to https://github.com/pgjdbc/pgjdbc/issu... — committed to azraino/pgjdbc by mamghari 4 years ago
- docs: change readOnlyMode on connect.md documentation (#1784) change the documentation by completing documentation with parameter that didn't exist the change is due to https://github.com/pgjdbc/... — committed to pgjdbc/pgjdbc by azraino 4 years ago
- feat: read only transactions (#1252) * feat: read only transactions If autocommit is set to false, read only will be set on begin transaction. If autocommit is true, it will continue to be manag... — committed to davecramer/pgjdbc by bokken 5 years ago
- docs: change readOnlyMode on connect.md documentation (#1784) change the documentation by completing documentation with parameter that didn't exist the change is due to https://github.com/pgjdbc/... — committed to davecramer/pgjdbc by azraino 4 years ago
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.