Skip to content

Conversation

@elprans
Copy link
Member

@elprans elprans commented Sep 12, 2017

No description provided.

We already check for attempts to use connection methods after the connection has been returned to the pool. This adds a similar check for objects associated with the connection: prepared statements and cursors. Issue: #190.
@elprans elprans requested a review from 1st1 September 12, 2017 14:35

def __init__(self, connection):
self._connection = connection
self._con_release_ctr = getattr(connection, '_pool_release_ctr', None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why getattr?


# Invalidate external references to the connection.
self._con._pool_release_ctr += 1
self._con._on_release()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inc '_pool_release_ctr' in '_on_release'?

@elprans elprans merged commit d085d2c into master Sep 12, 2017
@elprans elprans deleted the connvalidity branch September 12, 2017 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants