File contents
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" />
<title>What's new in ZODB3 3.6.0?</title>
<link rel="stylesheet" href="default.css" type="text/css" />
</head>
<body>
<div class="document" id="what-s-new-in-zodb3-3-6-0">
<h1 class="title">What's new in ZODB3 3.6.0?</h1>
<p>Release date: 05-Jan-2006</p>
<p>Following is combined news from internal releases (to support ongoing
Zope3 development). These are the dates of the internal releases:</p>
<ul class="simple">
<li>3.6b6 01-Jan-2006</li>
<li>3.6b5 18-Dec-2005</li>
<li>3.6b4 04-Dec-2005</li>
<li>3.6b3 06-Nov-2005</li>
<li>3.6b2 25-Oct-2005</li>
<li>3.6b1 24-Oct-2005</li>
<li>3.6a4 07-Oct-2005</li>
<li>3.6a3 07-Sep-2005</li>
<li>3.6a2 06-Sep-2005</li>
<li>3.6a1 04-Sep-2005</li>
</ul>
<div class="section" id="removal-of-features-deprecated-in-zodb-3-4">
<h1><a name="removal-of-features-deprecated-in-zodb-3-4">Removal of Features Deprecated in ZODB 3.4</a></h1>
<p>(3.6b2) ZODB 3.6 no longer contains features officially deprecated in the
ZODB 3.4 release. These include:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">get_transaction()</span></tt>. Use <tt class="docutils literal"><span class="pre">transaction.get()</span></tt> instead.
<tt class="docutils literal"><span class="pre">transaction.commit()</span></tt> is a shortcut spelling of
<tt class="docutils literal"><span class="pre">transaction.get().commit()</span></tt>, and <tt class="docutils literal"><span class="pre">transaction.abort()</span></tt>
of <tt class="docutils literal"><span class="pre">transaction.get().abort()</span></tt>. Note that importing ZODB no longer
installs <tt class="docutils literal"><span class="pre">get_transaction</span></tt> as a name in Python's <tt class="docutils literal"><span class="pre">__builtin__</span></tt>
module either.</li>
<li>The <tt class="docutils literal"><span class="pre">begin()</span></tt> method of <tt class="docutils literal"><span class="pre">Transaction</span></tt> objects. Use the <tt class="docutils literal"><span class="pre">begin()</span></tt>
method of a transaction manager instead. <tt class="docutils literal"><span class="pre">transaction.begin()</span></tt> is
a shortcut spelling to call the default transaction manager's <tt class="docutils literal"><span class="pre">begin()</span></tt>
method.</li>
<li>The <tt class="docutils literal"><span class="pre">dt</span></tt> argument to <tt class="docutils literal"><span class="pre">Connection.cacheMinimize()</span></tt>.</li>
<li>The <tt class="docutils literal"><span class="pre">Connection.cacheFullSweep()</span></tt> method. Use <tt class="docutils literal"><span class="pre">cacheMinimize()</span></tt>
instead.</li>
<li>The <tt class="docutils literal"><span class="pre">Connection.getTransaction()</span></tt> method. Pass a transaction manager
to <tt class="docutils literal"><span class="pre">DB.open()</span></tt> instead.</li>
<li>The <tt class="docutils literal"><span class="pre">Connection.getLocalTransaction()</span></tt> method. Pass a transaction
manager to <tt class="docutils literal"><span class="pre">DB.open()</span></tt> instead.</li>
<li>The <tt class="docutils literal"><span class="pre">cache_deactivate_after</span></tt> and <tt class="docutils literal"><span class="pre">version_cache_deactivate_after</span></tt>
arguments to the <tt class="docutils literal"><span class="pre">DB</span></tt> constructor.</li>
<li>The <tt class="docutils literal"><span class="pre">temporary</span></tt>, <tt class="docutils literal"><span class="pre">force</span></tt>, and <tt class="docutils literal"><span class="pre">waitflag</span></tt> arguments
to <tt class="docutils literal"><span class="pre">DB.open()</span></tt>. <tt class="docutils literal"><span class="pre">DB.open()</span></tt> no longer blocks (there's no longer
a fixed limit on the number of open connections).</li>
<li>The <tt class="docutils literal"><span class="pre">transaction</span></tt> and <tt class="docutils literal"><span class="pre">txn_mgr``arguments</span> <span class="pre">to</span> <span class="pre">``DB.open()</span></tt>. Use
the <tt class="docutils literal"><span class="pre">transaction_manager</span></tt> argument instead.</li>
<li>The <tt class="docutils literal"><span class="pre">getCacheDeactivateAfter</span></tt>, <tt class="docutils literal"><span class="pre">setCacheDeactivateAfter</span></tt>,
<tt class="docutils literal"><span class="pre">getVersionCacheDeactivateAfter</span></tt> and <tt class="docutils literal"><span class="pre">setVersionCacheDeactivateAfter</span></tt>
methods of <tt class="docutils literal"><span class="pre">DB</span></tt>.</li>
</ul>
</div>
<div class="section" id="persistent">
<h1><a name="persistent">Persistent</a></h1>
<ul class="simple">
<li>(3.6a4) ZODB 3.6 introduces a change to the basic behavior of Persistent
objects in a particular end case. Before ZODB 3.6, setting
<tt class="docutils literal"><span class="pre">obj._p_changed</span></tt> to a true value when <tt class="docutils literal"><span class="pre">obj</span></tt> was a ghost was ignored:
<tt class="docutils literal"><span class="pre">obj</span></tt> remained a ghost, and getting <tt class="docutils literal"><span class="pre">obj._p_changed</span></tt> continued to
return <tt class="docutils literal"><span class="pre">None</span></tt>. Starting with ZODB 3.6, <tt class="docutils literal"><span class="pre">obj</span></tt> is activated instead
(unghostified), and its state is changed from the ghost state to the
changed state. The new behavior is less surprising and more robust.</li>
<li>(3.6b5) The documentation for <tt class="docutils literal"><span class="pre">_p_oid</span></tt> now specifies the concrete
type of oids (in short, an oid is either None or a non-empty string).</li>
</ul>
</div>
<div class="section" id="commit-hooks">
<h1><a name="commit-hooks">Commit hooks</a></h1>
<ul class="simple">
<li>(3.6a1) The <tt class="docutils literal"><span class="pre">beforeCommitHook()</span></tt> method has been replaced by the new
<tt class="docutils literal"><span class="pre">addBeforeCommitHook()</span></tt> method, with a more-robust signature.
<tt class="docutils literal"><span class="pre">beforeCommitHook()</span></tt> is now deprecated, and will be removed in ZODB 3.8.
Thanks to Julien Anguenot for contributing code and tests.</li>
</ul>
</div>
<div class="section" id="connection-management">
<h1><a name="connection-management">Connection management</a></h1>
<ul class="simple">
<li>(3.6b6) When more than <tt class="docutils literal"><span class="pre">pool_size</span></tt> connections have been closed,
<tt class="docutils literal"><span class="pre">DB</span></tt> forgets the excess (over <tt class="docutils literal"><span class="pre">pool_size</span></tt>) connections closed first.
Python's cyclic garbage collection can take "a long time" to reclaim them
(and may in fact never reclaim them if application code keeps strong
references to them), but such forgotten connections can never be opened
again, so their caches are now cleared at the time <tt class="docutils literal"><span class="pre">DB</span></tt> forgets them.
Most applications won't notice a difference, but applications that open
many connections, and/or store many large objects in connection caches,
and/or store limited resources (such as RDB connections) in connection
caches may benefit.</li>
</ul>
</div>
<div class="section" id="zeo">
<h1><a name="zeo">ZEO</a></h1>
<ul class="simple">
<li>(3.6a4) Collector 1900. In some cases of pickle exceptions raised by
low-level ZEO communication code, callers of <tt class="docutils literal"><span class="pre">marshal.encode()</span></tt> could
attempt to catch an exception that didn't actually exist, leading to an
erroneous <tt class="docutils literal"><span class="pre">AttributeError</span></tt> exception. Thanks to Tres Seaver for the
diagnosis.</li>
</ul>
</div>
<div class="section" id="basestorage">
<h1><a name="basestorage">BaseStorage</a></h1>
<ul class="simple">
<li>(3.6a4) Nothing done by <tt class="docutils literal"><span class="pre">tpc_abort()</span></tt> should raise an exception.
However, if something does (an error case), <tt class="docutils literal"><span class="pre">BaseStorage.tpc_abort()</span></tt>
left the commit lock in the acquired state, causing any later attempt
to commit changes hang.</li>
</ul>
</div>
<div class="section" id="multidatabase">
<h1><a name="multidatabase">Multidatabase</a></h1>
<ul class="simple">
<li>(3.6b1) The <tt class="docutils literal"><span class="pre">database_name</span></tt> for a database in a multidatabase
collection can now be specified in a config file's <tt class="docutils literal"><span class="pre"><zodb></span></tt> section,
as the value of the optional new <tt class="docutils literal"><span class="pre">database_name</span></tt> key. The
<tt class="docutils literal"><span class="pre">.databases</span></tt> attribute cannot be specified in a config file, but
can be passed as the optional new <tt class="docutils literal"><span class="pre">databases</span></tt> argument to the
<tt class="docutils literal"><span class="pre">open()</span></tt> method of a ZConfig factory for type <tt class="docutils literal"><span class="pre">ZODBDatabase</span></tt>.
For backward compatibility, Zope 2.9 continues to allow using the
name in its <tt class="docutils literal"><span class="pre"><zodb_db</span> <span class="pre">name></span></tt> config section as the database name
(note that <tt class="docutils literal"><span class="pre"><zodb_db></span></tt> is defined by Zope, not by ZODB -- it's a
Zope-specific extension of ZODB's <tt class="docutils literal"><span class="pre"><zodb></span></tt> section).</li>
</ul>
</div>
<div class="section" id="persistentmapping">
<h1><a name="persistentmapping">PersistentMapping</a></h1>
<ul class="simple">
<li>(3.6b4) <tt class="docutils literal"><span class="pre">PersistentMapping</span></tt> makes changes by a <tt class="docutils literal"><span class="pre">pop()</span></tt> method call
persistent now.</li>
<li>(3.6a1) The <tt class="docutils literal"><span class="pre">PersistentMapping</span></tt> class has an <tt class="docutils literal"><span class="pre">__iter__()</span></tt> method
now, so that objects of this type work well with Python's iteration
protocol. For example, if <tt class="docutils literal"><span class="pre">x</span></tt> is a <tt class="docutils literal"><span class="pre">PersistentMapping</span></tt> (or
Python dictionary, or BTree, or <tt class="docutils literal"><span class="pre">PersistentDict</span></tt>, ...), then
<tt class="docutils literal"><span class="pre">for</span> <span class="pre">key</span> <span class="pre">in</span> <span class="pre">x:</span></tt> iterates over the keys of <tt class="docutils literal"><span class="pre">x</span></tt>, <tt class="docutils literal"><span class="pre">list(x)</span></tt> creates
a list containing <tt class="docutils literal"><span class="pre">x</span></tt>'s keys, <tt class="docutils literal"><span class="pre">iter(x)</span></tt> creates an iterator for
<tt class="docutils literal"><span class="pre">x</span></tt>'s keys, and so on.</li>
</ul>
</div>
<div class="section" id="tools">
<h1><a name="tools">Tools</a></h1>
<ul class="simple">
<li>(3.6b5) The changeover from zLOG to the logging module means that some
tools need to perform minimal logging configuration themselves. Changed
the zeoup script to do so and thus enable it to emit error messages.</li>
</ul>
</div>
<div class="section" id="btrees">
<h1><a name="btrees">BTrees</a></h1>
<ul class="simple">
<li>(3.6a1) BTrees and Buckets now implement the <tt class="docutils literal"><span class="pre">setdefault()</span></tt> and <tt class="docutils literal"><span class="pre">pop()</span></tt>
methods. These are exactly like Python's dictionary methods of the same
names, except that <tt class="docutils literal"><span class="pre">setdefault()</span></tt> requires both arguments (and Python is
likely to change to require both arguments too -- defaulting the
<tt class="docutils literal"><span class="pre">default</span></tt> argument to <tt class="docutils literal"><span class="pre">None</span></tt> has no viable use cases). Thanks to
Ruslan Spivak for contributing code, tests, and documentation.</li>
<li>(3.6a1) Collector 1873. It wasn't possible to construct a BTree or Bucket
from, or apply their update() methods to, a PersistentMapping or
PersistentDict. This works now.</li>
</ul>
</div>
<div class="section" id="zopeundo">
<h1><a name="zopeundo">ZopeUndo</a></h1>
<ul class="simple">
<li>(3.6a4) Collector 1810. A previous bugfix (#1726) broke listing undoable
transactions for users defined in a non-root acl_users folder. Zope logs
a acl_users path together with a username (separated by a space) and this
previous fix failed to take this into account.</li>
</ul>
</div>
<div class="section" id="connection">
<h1><a name="connection">Connection</a></h1>
<ul class="simple">
<li>(3.6b5) An optimization for loading non-current data (MVCC) was
inadvertently disabled in <tt class="docutils literal"><span class="pre">_setstate()</span></tt>; this has been repaired.</li>
</ul>
</div>
<div class="section" id="documentation">
<h1><a name="documentation">Documentation</a></h1>
<ul class="simple">
<li>(3.6b3) Thanks to Stephan Richter for converting many of the doctest
files to ReST format. These are now chapters in the Zope 3 apidoc too.</li>
<li>(3.6b4) Several misspellings of "occurred" were repaired.</li>
</ul>
</div>
<div class="section" id="development">
<h1><a name="development">Development</a></h1>
<ul class="simple">
<li>(3.6a1) The source code for the old ExtensionClass-based Persistence
package moved, from ZODB to the Zope 2.9 development tree. ZODB 3.5
makes no use of Persistence, and, indeed, the Persistence package could
not be compiled from a ZODB release, since some of the C header files
needed appear only in Zope.</li>
<li>(3.6a3) Re-added the <tt class="docutils literal"><span class="pre">zeoctl</span></tt> module, for the same reasons
<tt class="docutils literal"><span class="pre">mkzeoinst</span></tt> was re-added (see below).</li>
<li>(3.6a2) The <tt class="docutils literal"><span class="pre">mkzeoinst</span></tt> module was re-added to ZEO, because Zope3
has a script that expects to import it from there. ZODB's <tt class="docutils literal"><span class="pre">mkzeoinst</span></tt>
script was rewritten to invoke the <tt class="docutils literal"><span class="pre">mkzeoinst</span></tt> module.</li>
</ul>
</div>
<div class="section" id="transact">
<h1><a name="transact"><tt class="docutils literal"><span class="pre">transact</span></tt></a></h1>
<ul class="simple">
<li>(3.6b4) Collector 1959: The undocumented <tt class="docutils literal"><span class="pre">transact</span></tt> module no
longer worked. It remains undocumented and untested, but thanks to
Janko Hauser it's possible that it works again ;-).</li>
</ul>
</div>
</div>
</body>
</html>