Skip to content

Conversation

@dvarrazzo
Copy link
Member

Reported by David Raymond in a private message:

With the read_only and deferrable attributes of a connection it says in the docs
"None means use the default set in the default_transaction_ configuration parameter of the server."

However, while they start out as None, you cannot explicitly change those to None. When you try, it explicitly turns your value into a bool, and bool(None) is False.

In the pure python version this is in connection.py, lines 233 and 252.

So there's no way to reset these attributes of a connection "back to the server default". Once you set it to anything it will always be True or False, and thus explicitly start each transaction with either "BEGIN READ ONLY" or "BEGIN READ WRITE", and never again with just "BEGIN".

Bug confirmed and reproduced in the test suite. Opening a Pull Request to assign it a number.

@dvarrazzo dvarrazzo force-pushed the fix/transaction-attribute-default branch from 3ce1c5e to b764bc9 Compare July 31, 2023 23:01
@dvarrazzo dvarrazzo force-pushed the fix/transaction-attribute-default branch from b764bc9 to c8c2280 Compare July 31, 2023 23:58
@dvarrazzo dvarrazzo merged commit c8c2280 into master Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants