ZODB v3.4.a1 Release Notes

  • ๐Ÿš€ Release date: 01-Apr-2005

    transaction

    • ๐Ÿšš get_transaction() is officially deprecated now, and will be removed in ZODB 3.6. Use the transaction package instead. For example, instead of::

      import ZODB ... get_transaction().commit()

    do::

      import transaction
      ...
      transaction.commit()
    

    DB

    • There is no longer a hard limit on the number of connections that DB.open() will create. In other words, DB.open() never blocks anymore waiting for an earlier connection to close, and DB.open() always returns a connection now (while it wasn't documented, it was possible for DB.open() to return None before).

    pool_size continues to default to 7, but its meaning has changed: if more than pool_size connections are obtained from DB.open() and not closed, a warning is logged; if more than twice pool_size, a critical problem is logged. pool_size should be set to the maximum number of connections from the DB instance you expect to have open simultaneously.

    In addition, if a connection obtained from DB.open() becomes unreachable without having been explicitly closed, when Python's garbage collection reclaims that connection it no longer counts against the pool_size thresholds for logging messages.

    The following optional arguments to DB.open() are deprecated: transaction, waitflag, force and temporary. If one is specified, its value is ignored, and DeprecationWarning is raised. In ZODB 3.6, these optional arguments will be removed.

    • ๐Ÿ‘ Lightweight support for "multi-databases" is implemented. These are collections of named DB objects and associated open Connections, such that the Connection for any DB in the collection can be obtained from a Connection from any other DB in the collection. See the new test file ZODB/tests/multidb.txt for a tutorial doctest. Thanks to Christian Theune for his work on this during the PyCon 2005 ZODB sprint.

    ZEO compatibility

    There are severe restrictions on using ZEO servers and clients at or after ๐Ÿ‘€ ZODB 3.3 with ZEO servers and clients from ZODB versions before 3.3. See the reworked Compatibility section in README.txt for details. If ๐Ÿšš possible, it will be easiest to move clients and servers to 3.3+ simultaneously. With care, it's possible to use a 3.3+ ZEO server with pre-3.3 ZEO clients, but not possible to use a pre-3.3 ZEO server with 3.3+ ZEO clients.

    BTrees

    • A new family of BTree types, in the IFBTree module, map signed integers (32 bits) to C floats (also 32 bits). The intended use is to help construct search indices, where, e.g., integer word or document identifiers map to scores of some kind. This is easier than trying to work with scaled integer scores in an IIBTree, and Zope3 has moved to IFBTrees for these purposes in its search code.

    FileStorage

    • โž• Addded a record iteration protocol to FileStorage. You can use the record iterator to iterate over all current revisions of data pickles in the storage.

    In order to support calling via ZEO, we don't implement this as an actual iterator. An example of using the record iterator protocol is as follows::

      storage = FileStorage('anexisting.fs')
      next_oid = None
      while True:
          oid, tid, data, next_oid = storage.record_iternext(next_oid)
          # do something with oid, tid and data
          if next_oid is None:
              break
    

    The behavior of the iteration protocol is now to iterate over all current records in the database in ascending oid order, although this is not a promise to do so in the future.

    Tools

    ๐Ÿ†• New tool fsoids.py, for heavy debugging of FileStorages; shows all ๐Ÿ‘‰ uses of specified oids in the entire database (e.g., suppose oid 0x345620 is missing -- did it ever exist? if so, when? who referenced it? when was the last transaction that modified an object that referenced it? which objects did it reference? what kind of object was it?). โœ… ZODB/test/testfsoids.py is a tutorial doctest.

    fsIndex

    Efficient, general implementations of minKey() and maxKey() methods were added. fsIndex is a special hybrid kind of BTree used to implement โœ… FileStorage indices. Thanks to Chris McDonough for code and tests.