Commit fefa5024 authored by Tim Peters's avatar Tim Peters

Rebuild tag with fix for year-old bug in ZApplication.py,

noted by eyeball on zodb-dev by Stefan Holek.
parents e08cfd0f 35c02219
...@@ -14,6 +14,12 @@ transaction ...@@ -14,6 +14,12 @@ transaction
transaction object. As a result, the ``afterCompletion()`` methods of transaction object. As a result, the ``afterCompletion()`` methods of
registered synchronizers weren't called when the first transaction ended. registered synchronizers weren't called when the first transaction ended.
ZApplication
------------
- The ``__call__`` method didn't work if a non-None ``connection`` string
argument was passed. Thanks to Stefan Holek for noticing.
What's new in ZODB3 3.4a6? What's new in ZODB3 3.4a6?
========================== ==========================
......
...@@ -74,7 +74,7 @@ class ZApplicationWrapper: ...@@ -74,7 +74,7 @@ class ZApplicationWrapper:
if connection is None: if connection is None:
connection=db.open() connection=db.open()
elif isinstance(type, basestring): elif isinstance(connection, basestring):
connection=db.open(connection) connection=db.open(connection)
return connection.root()[aname] return connection.root()[aname]
......
...@@ -61,10 +61,10 @@ a weird traceback then ;-) ...@@ -61,10 +61,10 @@ a weird traceback then ;-)
One more, very obscure. It was the case that if the first action a new One more, very obscure. It was the case that if the first action a new
threaded transaction manager saw was a begin() call, then synchronizers threaded transaction manager saw was a begin() call, then synchronizers
registered after that in the same transaction weren't communicated to registered after that in the same transaction weren't communicated to
the Transaction object, and so the storage's afterCompletion() hook wasn't the Transaction object, and so the synchronizers' afterCompletion() hooks
called when the transaction commited. None of the test suites (ZODB's, weren't called when the transaction commited. None of the test suites
Zope 2.8's, or Zope3's) caught that, but apparently Zope3 takes this path (ZODB's, Zope 2.8's, or Zope3's) caught that, but apparently Zope3 takes this
at some point when serving pages. path at some point when serving pages.
>>> tm = transaction.ThreadTransactionManager() >>> tm = transaction.ThreadTransactionManager()
>>> st.sync_called = False >>> st.sync_called = False
...@@ -75,8 +75,8 @@ at some point when serving pages. ...@@ -75,8 +75,8 @@ at some point when serving pages.
>>> st.sync_called >>> st.sync_called
False False
Now ensure that st.afterCompletion() gets called by commit despite that the Now ensure that cn.afterCompletion() -> st.sync() gets called by commit
Connection registered after the transaction began: despite that the Connection registered after the transaction began:
>>> tm.commit() >>> tm.commit()
>>> st.sync_called >>> st.sync_called
......
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