[Zope-dev] Zope 2.7 breaks auto refresh

Santi Camps santi at zetadb.com
Wed Mar 3 08:42:40 EST 2004


Hi again,

I've this traceback using Zope 2.7.0 final:

Module ZPublisher.Publish, line 163, in publish_module_standard
      * Module ZPublisher.Publish, line 127, in publish
      * Module Zope.App.startup, line 203, in zpublisher_exception_hook
      * Module ZPublisher.Publish, line 104, in publish
      * Module Zope.App.startup, line 221, in commit
      * Module ZODB.Transaction, line 233, in commit
      * Module ZODB.Transaction, line 348, in _commit_objects
      * Module ZODB.Connection, line 435, in commit
        __traceback_info__: (('Products.Transience.TransientObject',
        'TransientObject'), '\x00\x00\x00\x00\x00\x00\x008', '')


The error is caused during the "auto refresh" hook.  If auto refresh is
disabled, all works fine.  I've seen that there is a bug in the
collector about this issue: http://zope.org/Collectors/Zope/1010

I've tryied to understand the problem.  It seems that now Trasicience
uses a different ZODB connection (using DBTab), and I think this is the
cause of the problem.  

In Zope/App/startup.py, there is the following lines:

    # Initialize the app object
    application = app()
    OFS.Application.initialize(application)
    if Globals.DevelopmentMode:
        # Set up auto-refresh.
        from App.RefreshFuncs import setupAutoRefresh
        setupAutoRefresh(application._p_jar)
    application._p_jar.close()


This handles the autoRefresh machinery to the main Connection, but I've
not found anywhere the same has been done with temporary Connection.  

But in the ZODB/Connection.py there is a global_code_timestamp used to
compare all Connections _code_timestamp attribute.   

Then, when the Connection tries to commit, as the _code_timestamp of
Trasicience connection hasn't been updated, the problem appears.  Almost
is what I think.

If anybody can put me in the right direction I can try to provide a
patch.  What do you think ?  Which is the best way to solve this
problem?

Thanks a lot

-- 
Santi Camps
http://zetadb.sourceforge.net




More information about the Zope-Dev mailing list