Commit 983182fd authored by Jim Fulton's avatar Jim Fulton

Fixed a bug in mapping storage that caused hangs in transactions after

empty transactions.
parent a2de43e3
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
3.9.0a2 (2008-??-??) 3.9.0a2 (2008-??-??)
==================== ====================
New Features
------------
- The connection now estimates the object size based on its pickle size - The connection now estimates the object size based on its pickle size
and informs the cache about size changes. and informs the cache about size changes.
...@@ -19,6 +22,12 @@ ...@@ -19,6 +22,12 @@
XXX There are known issues with this implementation that need to be XXX There are known issues with this implementation that need to be
sorted out before it is "released". sorted out before it is "released".
Bug Fixes
---------
- MappingStorage hung when committing a transaction *after* committing
an empty transaction.
3.9.0a1 (2008-10-29) 3.9.0a1 (2008-10-29)
==================== ====================
......
...@@ -286,7 +286,7 @@ class MappingStorage(object): ...@@ -286,7 +286,7 @@ class MappingStorage(object):
# ZODB.interfaces.IStorage # ZODB.interfaces.IStorage
@ZODB.utils.locked(opened) @ZODB.utils.locked(opened)
def tpc_finish(self, transaction, func = lambda tid: None): def tpc_finish(self, transaction, func = lambda tid: None):
if (transaction is not self._transaction) or not self._tdata: if (transaction is not self._transaction):
return return
tid = self._tid tid = self._tid
......
...@@ -183,3 +183,19 @@ class BasicStorage: ...@@ -183,3 +183,19 @@ class BasicStorage:
def checkInterfaces(self): def checkInterfaces(self):
for iface in zope.interface.providedBy(self._storage): for iface in zope.interface.providedBy(self._storage):
zope.interface.verify.verifyObject(iface, self._storage) zope.interface.verify.verifyObject(iface, self._storage)
def checkMultipleEmptyTransactions(self):
# There was a bug in handling empty transactions in mapping
# storage that caused the commit lock not to be released. :(
transaction.begin()
t = transaction.get()
self._storage.tpc_begin(t)
self._storage.tpc_vote(t)
self._storage.tpc_finish(t)
t.commit()
transaction.begin()
t = transaction.get()
self._storage.tpc_begin(t) # Hung here before
self._storage.tpc_vote(t)
self._storage.tpc_finish(t)
t.commit()
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