[Zope-dev] Zope 2.7 breaks auto refresh

Jeremy Hylton jeremy at zope.com
Wed Mar 3 12:37:45 EST 2004


On Wed, 2004-03-03 at 08:42, Santi Camps wrote:
> 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', '')

I don't understand this traceback entirely.  What is the exception that
is being raised?  Also, the last line in the traceback doesn't match a
line on my copy of ZODB/Connection.py.  (I've got revision 1.98.4.5.)

> 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.

I'm not very familiar with the App.RefreshFuncs code, but I think I can
offer some generic comments.  setupAutoRefresh() calls
ZODB.Connection.updateCodeTimestamp() which will cause every Connection
to reset its cache the next time it is opened.  It wouldn't be safe to
reset the cache at other times, because application code could have a
reference to existing objects.

I don't know how all this affects the Transience connection.  When is it
opened and closed?

Jeremy





More information about the Zope-Dev mailing list