@@ -61,17 +61,18 @@ def __init__(self, dsn, tilevel, typecasts, enc='utf-8'):
6161
6262 def getconn (self , init = 'ignored' ):
6363 if self ._conn :
64- # As the TM is a short-lived object, keep a reference to the connection - we really
65- # expect the pool's getconn() to reliably return the same connection anyway.
66- # This is needed to differentiate between an initial connection
67- # where its fine to keep going through the pool and fetching a new one
68- # versus an existing connection in a running transaction where e.g. a failure
69- # on the server side has aborted the transaction and we can't e.g. run `select 1`
70- # any longer but we also need the original connection to clean up correctly within
71- # Zope's transaction management.
72- # Theoretically this could be placed in `_register()` but I'm not 100% sure
73- # someone might be using getconn() without the TM integration thus going around
74- # `_register()` ...
64+ # As the TM is a short-lived object, keep a reference to the
65+ # connection - we really expect the pool's getconn() to reliably
66+ # return the same connection anyway. This is needed to
67+ # differentiate between an initial connection where its fine to
68+ # keep going through the pool and fetching a new one versus an
69+ # existing connection in a running transaction where e.g. a failure
70+ # on the server side has aborted the transaction and we can't e.g.
71+ # run `select 1` any longer but we also need the original
72+ # connection to clean up correctly within Zope's transaction
73+ # management. Theoretically this could be placed in `_register()`
74+ # but I'm not 100% sure someone might be using getconn() without
75+ # the TM integration thus going around `_register()` ...
7576 return self ._conn
7677
7778 _pool = pool .getpool (self .dsn , create = True )
0 commit comments