[Zope-dev] Zope 2.7 breaks auto refresh
Santi Camps
santi at zetadb.com
Wed Mar 3 13:06:56 EST 2004
> 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.)
>
Sorry, the full Traceback is this one (the previous one has a modified
version of Connection.py to add some LOGs):
Traceback (innermost last):
* 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 425, in commit
__traceback_info__: (('Products.Transience.TransientObject',
'TransientObject'), '\x00\x00\x00\x00\x00\x00\x00)', '')
ValueError: Cache values may only be in one cache. (Also, an error
occurred while attempting to render the standard error message.)
After that, any try to work with the applications raises this other one:
Traceback (innermost last):
* 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 425, in commit
__traceback_info__: (('BTrees.OOBTree', 'OOBTree'),
'\x00\x00\x00\x00\x00\x00\x00\x0e', '')
ValueError: Cache values may only be in one cache. (Also, an error
occurred while attempting to render the standard error message.)
> > 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
I think the error is produced after the second store in the SESSION
variable. Perhaps the problem is that the temporary Connection is not
closed and openned right. I will continue debugging
Thanks for your answer
--
Santi Camps
http://zetadb.sourceforge.net
More information about the Zope-Dev
mailing list