- Pool listeners can now be provided as a dictionary of
callables or a (possibly partial) duck-type of
PoolListener, your choice.
+
+ - added "rollback_returned" option to Pool which will
+ disable the rollback() issued when connections are
+ returned. This flag is only safe to use with a database
+ which does not support transactions (i.e. MySQL/MyISAM).
- mssql
- Added "odbc_autotranslate" parameter to engine / dburi
"""
- def __init__(self, creator, recycle=-1, echo=None, use_threadlocal=True,
+ def __init__(self, creator, recycle=-1, echo=None, use_threadlocal=True, rollback_returned=True,
listeners=None):
self.logger = logging.instance_logger(self, echoflag=echo)
# the WeakValueDictionary works more nicely than a regular dict
self._creator = creator
self._recycle = recycle
self._use_threadlocal = use_threadlocal
+ self._rollback_returned = rollback_returned
self.echo = echo
self.listeners = []
self._on_connect = []
return
if connection is not None:
try:
- connection.rollback()
+ if pool._rollback_returned:
+ connection.rollback()
# Immediately close detached instances
if connection_record is None:
connection.close()