Commit abfc5a53 authored by Jim Fulton's avatar Jim Fulton

Fixed a stupid race condition in close that caused the conection

pool to go south when there were more app threads than connections.
parent 682cd342
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
"""Database connection support """Database connection support
$Id: Connection.py,v 1.11 1999/06/29 18:28:16 jim Exp $""" $Id: Connection.py,v 1.12 1999/07/05 21:07:37 jim Exp $"""
__version__='$Revision: 1.11 $'[11:-2] __version__='$Revision: 1.12 $'[11:-2]
from cPickleCache import PickleCache from cPickleCache import PickleCache
from POSException import ConflictError, ExportError from POSException import ConflictError, ExportError
...@@ -211,7 +211,7 @@ class Connection(ExportImport.ExportImport): ...@@ -211,7 +211,7 @@ class Connection(ExportImport.ExportImport):
return oid return oid
def _setDB(self, odb=None): def _setDB(self, odb):
"""Begin a new transaction. """Begin a new transaction.
Any objects modified since the last transaction are invalidated. Any objects modified since the last transaction are invalidated.
...@@ -232,8 +232,9 @@ class Connection(ExportImport.ExportImport): ...@@ -232,8 +232,9 @@ class Connection(ExportImport.ExportImport):
def close(self): def close(self):
self._incrgc() self._incrgc()
self._db._closeConnection(self) db=self._db
self._db=self._storage=self._tmp=None self._db=self._storage=self._tmp=self.new_oid=None
db._closeConnection(self)
def commit(self, object, transaction): def commit(self, object, transaction):
oid=object._p_oid oid=object._p_oid
......
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