summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/threadlocal.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-17 19:59:45 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-17 19:59:45 -0500
commit7dab4ae6a9ca057bb99be2f01efc26610be12f63 (patch)
tree69e2a7a7bca8899c6fa44616c919cf3b232cb3a0 /lib/sqlalchemy/engine/threadlocal.py
parente7c5fd7b22dd21ec1c1cac177b9ee611779903e3 (diff)
downloadsqlalchemy-7dab4ae6a9ca057bb99be2f01efc26610be12f63.tar.gz
- rename EngineEvents to ConnectionEvents
- simplify connection event model to be inline inside Connection, don't use ad-hoc subclasses (technically would leak memory for the app that keeps creating engines and adding events) - not doing listen-per-connection yet. this is closer. overall things are much simpler now (until we put listen-per-connection in...)
Diffstat (limited to 'lib/sqlalchemy/engine/threadlocal.py')
-rw-r--r--lib/sqlalchemy/engine/threadlocal.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/sqlalchemy/engine/threadlocal.py b/lib/sqlalchemy/engine/threadlocal.py
index d4d0488a9..f3e84bef2 100644
--- a/lib/sqlalchemy/engine/threadlocal.py
+++ b/lib/sqlalchemy/engine/threadlocal.py
@@ -11,7 +11,7 @@ with :func:`~sqlalchemy.engine.create_engine`. This module is semi-private and
invoked automatically when the threadlocal engine strategy is used.
"""
-from sqlalchemy import util, event, events
+from sqlalchemy import util, event
from sqlalchemy.engine import base
import weakref
@@ -33,15 +33,6 @@ class TLConnection(base.Connection):
self.__opencount = 0
base.Connection.close(self)
-class TLEvents(events.EngineEvents):
- @classmethod
- def _listen(cls, target, identifier, fn):
- if target.TLConnection is TLConnection:
- target.TLConnection = base._listener_connection_cls(
- TLConnection,
- target.dispatch)
- events.EngineEvents._listen(target, identifier, fn)
-
class TLEngine(base.Engine):
"""An Engine that includes support for thread-local managed transactions."""
@@ -51,7 +42,6 @@ class TLEngine(base.Engine):
super(TLEngine, self).__init__(*args, **kwargs)
self._connections = util.threading.local()
- dispatch = event.dispatcher(TLEvents)
def contextual_connect(self, **kw):
if not hasattr(self._connections, 'conn'):