mapper since it's not needed.
- sql
- - NullPool supports reconnect on failure behavior.
- [ticket:1094]
-
- Columns can again contain percent signs within their
names. [ticket:1256]
__eq__(). If the object does not implement
__eq__() and mutable=True, a deprecation warning
is raised.
-
- - Connection.invalidate() checks for closed status
- to avoid attribute errors. [ticket:1246]
- Fixed the import weirdness in sqlalchemy.sql
to not export __names__ [ticket:1215].
LIMIT/OFFSET), you should also call self_group()
on it to apply parenthesis.
+
+- engine/pool
+
+ - Connection.invalidate() checks for closed status
+ to avoid attribute errors. [ticket:1246]
+
+ - NullPool supports reconnect on failure behavior.
+ [ticket:1094]
+
+ - Added a mutex for the initial pool creation when
+ using pool.manage(dbapi). This prevents a minor
+ case of "dogpile" behavior which would otherwise
+ occur upon a heavy load startup. [ticket:799]
+
- _execute_clauseelement() goes back to being
a private method. Subclassing Connection
is not needed now that ConnectionProxy
self.params = params
self.poolclass = poolclass
self.pools = {}
-
+ self._create_pool_mutex = threading.Lock()
+
def close(self):
for key in self.pools.keys():
del self.pools[key]
try:
return self.pools[key]
except KeyError:
- pool = self.poolclass(lambda: self.module.connect(*args, **params), **self.params)
- self.pools[key] = pool
- return pool
-
+ self._create_pool_mutex.acquire()
+ try:
+ if key not in self.pools:
+ pool = self.poolclass(lambda: self.module.connect(*args, **params), **self.params)
+ self.pools[key] = pool
+ return pool
+ else:
+ return self.pools[key]
+ finally:
+ self._create_pool_mutex.release()
+
def connect(self, *args, **params):
"""Activate a connection to the database.