ZODB v3.4.b1 Release Notes
-
๐ Release date: 19-May-2005
๐ What follows is combined news from the "internal releases" (to support ongoing Zope 2.8 and Zope3 development) since the last public ZODB 3.4 ๐ release. These are the dates of the internal releases:
- 3.4b1 19-May-2005
- 3.4a9 12-May-2005
- 3.4a8 09-May-2005
- 3.4a7 06-May-2005
- 3.4a6 05-May-2005
- 3.4a5 25-Apr-2005
- 3.4a4 23-Apr-2005
- 3.4a3 13-Apr-2005
- 3.4a2 03-Apr-2005
transaction
๐ (3.4a7) If the first activity seen by a new
ThreadTransactionManager
was an explicitbegin()
call, then synchronizers registered after that (but still during the first transaction) were not communicated to the transaction object. As a result, theafterCompletion()
methods of registered synchronizers weren't called when the first transaction ended.(3.4a6) Doing a subtransaction commit erroneously processed invalidations, which could lead to an inconsistent view of the database. For example, let T be the transaction of which the subtransaction commit was a part. If T read a persistent object O's state before the subtransaction commit, did not commit new state of its own for O during its subtransaction commit, and O was modified before the subtransaction commit by a different transaction, then the subtransaction commit processed an invalidation for O, and the state T read for O originally was discarded in T. If T went on to access O again, it saw the newly committed (by a different transaction) state for O::
o_attr = O.some_attribute get_transaction().commit(True) assert o_attr == O.some_attribute
could fail, and despite that T never modifed O.
๐ (3.4a4) Transactions now support savepoints. Savepoints allow changes to be periodically checkpointed within a transaction. You can then rollback to a previously created savepoint. See
transaction/savepoint.txt
.(3.4a6) A
getBeforeCommitHooks()
method was added. It returns an iterable producing the registered beforeCommit hooks.(3.4a6) The
ISynchronizer
interface has a newnewTransaction()
method. This is invoked whenever a transaction manager'sbegin()
method is called. (Note that a transaction object's (as opposed to a transaction manager's)begin()
method is deprecated, andnewTransaction()
is not called when using the deprecated method.)(3.4a6) Relatedly,
Connection
implementsISynchronizer
, andConnection
'safterCompletion()
andnewTransaction()
methods now callsync()
on the underlying storage (if the underlying storage has such a method), in addition to processing invalidations. The practical implication is that storage synchronization will be done automatically now, whenever a transaction is explicitly started, and after top-level transaction commit or abort. As a result,Connection.sync()
should virtually never be needed anymore, and will eventually be deprecated.(3.4a3) Transaction objects have a new method,
beforeCommitHook(hook, *args, **kws)
. Hook functions registered with a transaction are called at the start of a top-level commit, before any of the work is begun, so a hook function can perform any database operations it likes. Seetest_beforeCommitHook()
intransaction/tests/test_transaction.py
for a tutorial doctest, and theITransaction
interface for details. Thanks to Florent Guillaume for contributing code and tests.(3.4a3) Clarifications were made to transaction interfaces.
๐ Support for ZODB4 savepoint-aware data managers has been dropped
- ๐ (3.4a4) In adding savepoint support, we dropped the attempted support for ZODB4 data managers that support savepoints. We don't think that this will affect anyone.
ZEO
(3.4a4) The ZODB and ZEO version numbers are now the same. Concretely::
import ZODB, ZEO assert ZODB.version == ZEO.version
no longer fails. If interested, see the README file for details about earlier version numbering schemes.
(3.4b1) ZConfig version 2.3 adds new socket address types, for smoother default behavior across platforms. The hostname portion of socket-binding-address defaults to an empty string, which acts like INADDR_ANY on Windows and Linux (bind to any interface). The hostname portion of socket-connection-address defaults to "127.0.0.1" (aka "localhost"). In config files, the types of
zeo
section keysaddress
andmonitor-address
changed to socket-binding-address, and the type of thezeoclient
section keyserver
changed to socket-connection-address.0๏ธโฃ (3.4a4) The default logging setup in
runzeo.py
was broken. It was changed so that runningrunzeo.py
from a command line now, and without using a config file, prints output to the console much as ZODB 3.2 did.
๐ ZEO on Windows
๐ Thanks to Mark Hammond for these
runzeo.py
enhancements on Windows:(3.4b1) Collector 1788: Repair one of the new features below.
(3.4a4) A pid file (containing the process id as a decimal string) is created now for a ZEO server started via
runzeo.py
. External programs can read the pid from this file and derive a "signal name" used in a new signal-emulation scheme for Windows. This is only necessary on Windows, but the pid file is created on all platforms that implementos.getpid()
, as long as thepid-filename
option is set, or environment variableINSTANCE_HOME
is defined. Thepid-filename
option can be set in a ZEO config file, or passed as the new--pid-file
argument torunzeo.py
.๐ฆ (3.4a4) If available,
runzeo.py
now uses Zope's new 'Signal' mechanism for Windows, to implement clean shutdown and log rotation handlers for Windows. Note that the Python in use on the ZEO server must also have the Python Win32 extensions installed for this to be useful.
Tools
- (3.4a4)
fsdump.py
now displays the size (in bytes) of data records. This actually went in several months go, but wasn't noted here at the time. Thanks to Dmitry Vasiliev for contributing code and tests.
FileStorage
(3.4a9) The
undoLog()
andundoInfo()
methods almost always returned a wrong number of results, one too many iflast < 0
(the default is such a case), or one too few iflast >= 0
. These have been repaired, new tests were added, and these methods are now documented inZODB.interfaces.IStorageUndoable
.(3.4a2) A
pdb.set_trace()
call was mistakenly left in methodFileStorage.modifiedInVersion()
.
ZConfig
- ๐ (3.4b1) The "standalone" release of ZODB now includes ZConfig version 2.3.
DemoStorage
- (3.4a4) Appropriate implementations of the storage API's
registerDB()
andnew_oid()
methods were added, delegating to the base storage. This was needed to support wrapping a ZEO client storage as aDemoStorage
base storage, as some new Zope tests want to do.
BaseStorage
- ๐ (3.4a4)
new_oid()
's undocumentedlast=
argument was removed. It was used only for internal recursion, and injured code sanity elsewhere because not all storages included it in theirnew_oid()
's signature. Straightening this out required addinglast=
everywhere, or removing it everywhere. Since recursion isn't actually needed, and there was no other use forlast=
, removing it everywhere was the obvious choice.
โ Tests
(3.4a3) The various flavors of the
check2ZODBThreads
andcheck7ZODBThreads
tests are much less likely to suffer sproadic failures now.๐ (3.4a2) The test
checkOldStyleRoot
failed in Zope3, because of an obscure dependence on thePersistence
package (which Zope3 doesn't use).
ZApplication
๐ (3.4a8) The file
ZApplication.py
was moved, from ZODB to Zope(2). ZODB and Zope3 don't use it, but Zope2 does.(3.4a7) The
__call__
method didn't work if a non-Noneconnection
string argument was passed. Thanks to Stefan Holek for noticing.