Commit 23287d7e authored by Vincent Pelletier's avatar Vincent Pelletier

Add missing closeConnection method.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13937 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c60c3bb
...@@ -242,6 +242,20 @@ class ThreadedDB: ...@@ -242,6 +242,20 @@ class ThreadedDB:
finally: finally:
self._db_lock.release() self._db_lock.release()
def _pool_del(self, key):
self._db_lock.acquire()
try:
del self._db_pool[key]
finally:
self._db_lock.release()
def closeConnection(self):
ident = get_ident()
try:
self._pool_del(ident)
except KeyError:
pass
def _access_db(self, method_id, args, kw): def _access_db(self, method_id, args, kw):
""" """
Generic method to call pooled objects' methods. Generic method to call pooled objects' methods.
......
...@@ -240,6 +240,20 @@ class ThreadedDeferredDB: ...@@ -240,6 +240,20 @@ class ThreadedDeferredDB:
finally: finally:
self._db_lock.release() self._db_lock.release()
def _pool_del(self, key):
self._db_lock.acquire()
try:
del self._db_pool[key]
finally:
self._db_lock.release()
def closeConnection(self):
ident = get_ident()
try:
self._pool_del(ident)
except KeyError:
pass
def _access_db(self, method_id, args, kw): def _access_db(self, method_id, args, kw):
""" """
Generic method to call pooled objects' methods. Generic method to call pooled objects' methods.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment