Re: [ZODB-Dev] Cached object error while upgrading Plone
Hello Martijn, Actually for DirectoryViewSurrogate (see the second paste) that is not the case since it subclasses OFS.Folder.Folder - which is persistent. Alex. On 21 November 2011 21:13, Martijn Pieters m...@zopatista.com wrote: On Mon, Nov 21, 2011 at 18:40, Alexandru Plugaru alexandru.plug...@gmail.com wrote: I've got this error ( http://pastie.org/2898828 ) while upgrading from plone3 to plone4. The context in which that error happens is this: http://pastie.org/2898959 DirectoryViews are part of the CMF skin machinery and are not meant to be persisted. Something that is persistent is referring to the DirectoryView (or perhaps a contained skin item) where it should not. -- Martijn Pieters ___ For more information about ZODB, see http://zodb.org/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] Cached object error while upgrading Plone
Hello Shane, I think that you're right about the persistent to non-persistent changes and vice-versa. I will try to identify the object that does this. What do you mean by removing add-ons? You mean products? And if I remove my third party products and make the objects which subclass the ATFolder broken then I will not get the necessary upgrades specific to folders right? Thanks for your input, Alex. On 21 November 2011 21:05, Shane Hathaway sh...@hathawaymix.org wrote: On 11/21/2011 10:40 AM, Alexandru Plugaru wrote: Hello, I've got this error ( http://pastie.org/2898828 ) while upgrading from plone3 to plone4. The context in which that error happens is this: http://pastie.org/2898959 The only place I could find the error message was in cPersistence.c: http://svn.zope.org/*checkout*/ZODB/branches/3.9/src/persistent/cPersistence.c So I guess my question is how do I know if an object is cached? And maybe a theory of why this is happening. That kind of thing happens when a class changes from non-persistent to persistent or vice-versa. This may be caused by add-ons. When I do a major Plone upgrade, I first disable all add-ons temporarily and that usually does the trick. If that doesn't work, I suggest you get a list of all your add-ons and ask this question on a Plone list. Shane ___ For more information about ZODB, see http://zodb.org/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
[ZODB-Dev] Cached object error while upgrading Plone
Hello, I've got this error ( http://pastie.org/2898828 ) while upgrading from plone3 to plone4. The context in which that error happens is this: http://pastie.org/2898959 The only place I could find the error message was in cPersistence.c: http://svn.zope.org/*checkout*/ZODB/branches/3.9/src/persistent/cPersistence.c So I guess my question is how do I know if an object is cached? And maybe a theory of why this is happening. Thank you, Alex. ___ For more information about ZODB, see http://zodb.org/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] I would like to know if api exists nowadays to get list of all objects which where modified in a transaction ?
Hi, I would interested in this as well. Sometimes debugging becomes difficult for big transactions where multiple different objects are modified. Usually than happens from different parts of the code through subscribers to events. It would be great if this kind of feature existed so you could have an overview of what happens during a transaction. Alex. On 26 July 2011 10:55, Stéphane Klein steph...@harobed.org wrote: Hi, some time ago, someone ask how to get list of all objects which where modified in a transaction : http://article.gmane.org/gmane.comp.web.zope.zodb/5734 Jim Fulton said « there isn't a public API for this ». I would like to know if this api exists nowadays ? Regards, Stephane -- Stéphane Klein steph...@harobed.org blog: http://stephane-klein.info Twitter: http://twitter.com/klein_stephane pro: http://www.is-webdesign.com ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] TypeError: unbound method beforeCompletion() must be called with Synchronizer instance as first argument (got Transaction instance instead)
Hi Stéphane, I think you create an issue here: https://github.com/cguardia/ZODB-Documentation (or maybe even fix the example) Kind regards, Alex. On 26 July 2011 14:51, Stéphane Klein steph...@harobed.org wrote: Le 26/07/2011 13:48, Wichert Akkerman a écrit : On 07/26/2011 01:47 PM, Stéphane Klein wrote: Hi, I've this in my source code : from zope.interface import implements from transaction.interfaces import ISynchronizer class Synchronizer(object): implements(ISynchronizer) def beforeCompletion(self, transaction): print(beforeCompletion) def afterCompletion(self, transaction): print(afterCompletion, transaction) def newTransaction(self, transaction): print(newTransaction, transaction) ... transaction.manager.registerSynch(Synchronizer) I bet this works: transaction.manager.registerSynch(Synchronizer()) Ok, thanks then there are an issue here : http://www.zodb.org/zodbbook/transactions.html#synchronizers Regards, Stephane -- Stéphane Klein steph...@harobed.org blog: http://stephane-klein.info Twitter: http://twitter.com/klein_stephane pro: http://www.is-webdesign.com ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] I would like append an indexer with uuid key at root of my ZODB, how can I append an function to commit event to update this uuid catalog ?
Hi Stéphane, Maybe this will be helpful: http://www.zodb.org/documentation/articles/ZODB2.html#persistent-aware-types I think what you are looking for is an OOBTree with the key being your uuid and the value being the path to your Resources object. def get_uuid(uuid, context): resource_path = context.my_btree.get(uuid, None) if uuid is not None: return context.unrestrictedTraverse(resource_path) You can get the path of an object in OFS by calling absolute_url method of that object. Hope this helps, Alex. On 28 June 2011 12:10, Stéphane Klein steph...@harobed.org wrote: Le 28/06/2011 10:21, Thierry Florac a écrit : I use ZODB to record some Resources. All my Resources have an uuid field. All work well but I would like append a BTree to ZODB root object to index uuid of all my resources. I would like record to this BTree index only Resources commited to ZODB database. How can I connect a function to commit event ? In this function, how can I found all object modified ? How can I found all object removed to the database ? Other question : are there already a package to perform this task ? The matching package is zope.catalog. It provides all you need (catalog and indexes) to handle your task. Objects creations and modifications are followed automatically by several subscribers as soon as this package is correctly registered. z3c.catalog and hurry.query packages can be good extensions packages to look at... I've already looked zope.catalog and repoze.catalog. Question : I haven't docid, can I use uuid here ? but it isn't the feature I want : I would like retrieve my object from uuid. Do you have an example of code about it ? More information about my aim : root (ZODB) uuid = { uuid_value1: resource_A, uuid_value2: resource_B, ... } folder_1 resource_A folder_2 resource_B I would like this function : get_by_uuid(uuid_value1) = return resource_A Regards, Stephane -- Stéphane Klein steph...@harobed.org blog: http://stephane-klein.info Twitter: http://twitter.com/klein_stephane pro: http://www.is-webdesign.com ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev