[Zope] cookie crumbler
I have just been reading a Z2 log and have noticed that when I am logged in as a manager my username is displayed in the log, however when logged in using cookie crumbler as a normal user only 'Anonymous' appears as the user name in the log. Is there some way to make the correct user name appear in the log? AUTHENTICATED_USER returns the correct user name. I am using Zope 2.9.0. Thanks Garry ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: Products.Five/trunk/ Comply with repository policy.
Log message for revision 113601: Comply with repository policy. Changed: A Products.Five/trunk/COPYRIGHT.txt A Products.Five/trunk/LICENSE.txt -=- Added: Products.Five/trunk/COPYRIGHT.txt === --- Products.Five/trunk/COPYRIGHT.txt (rev 0) +++ Products.Five/trunk/COPYRIGHT.txt 2010-06-18 06:27:54 UTC (rev 113601) @@ -0,0 +1 @@ +Zope Foundation and Contributors \ No newline at end of file Property changes on: Products.Five/trunk/COPYRIGHT.txt ___ Added: svn:eol-style + native Added: Products.Five/trunk/LICENSE.txt === --- Products.Five/trunk/LICENSE.txt (rev 0) +++ Products.Five/trunk/LICENSE.txt 2010-06-18 06:27:54 UTC (rev 113601) @@ -0,0 +1,44 @@ +Zope Public License (ZPL) Version 2.1 + +A copyright notice accompanies this license document that identifies the +copyright holders. + +This license has been certified as open source. It has also been designated as +GPL compatible by the Free Software Foundation (FSF). + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions in source code must retain the accompanying copyright +notice, this list of conditions, and the following disclaimer. + +2. Redistributions in binary form must reproduce the accompanying copyright +notice, this list of conditions, and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Names of the copyright holders must not be used to endorse or promote +products derived from this software without prior written permission from the +copyright holders. + +4. The right to distribute this software or to use it for any purpose does not +give you the right to use Servicemarks (sm) or Trademarks (tm) of the +copyright +holders. Use of them is covered by separate agreement with the copyright +holders. + +5. If any files are modified, you must cause the modified files to carry +prominent notices stating that you changed the files and the date of any +change. + +Disclaimer + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Property changes on: Products.Five/trunk/LICENSE.txt ___ Added: svn:eol-style + native ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/src/OFS/interfaces.py - IContainmentRoot is now IRoot
Log message for revision 113612: - IContainmentRoot is now IRoot Changed: U Zope/trunk/src/OFS/interfaces.py -=- Modified: Zope/trunk/src/OFS/interfaces.py === --- Zope/trunk/src/OFS/interfaces.py2010-06-18 09:24:59 UTC (rev 113611) +++ Zope/trunk/src/OFS/interfaces.py2010-06-18 09:26:01 UTC (rev 113612) @@ -10,13 +10,15 @@ # FOR A PARTICULAR PURPOSE. # ## -OFS z3 interfaces. +OFS interfaces. $Id$ from zope.container.interfaces import IContainer from zope.interface import Attribute from zope.interface import Interface +from zope.location.interfaces import IPossibleSite +from zope.location.interfaces import IRoot from zope.schema import Bool, BytesLine, Tuple from AccessControl.interfaces import IOwned @@ -28,8 +30,6 @@ from webdav.interfaces import IDAVCollection from webdav.interfaces import IDAVResource -from zope.traversing.interfaces import IContainmentRoot -from zope.location.interfaces import IPossibleSite class IOrderedContainer(Interface): @@ -834,7 +834,7 @@ # XXX: might contain non-API methods and outdated comments; # not synced with ZopeBook API Reference; # based on OFS.Application.Application -class IApplication(IFolder, IContainmentRoot): +class IApplication(IFolder, IRoot): Top-level system object ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/rochael-TM_sortKey/doc/CHANGES.rst record setSortKey() changes
Log message for revision 113621: record setSortKey() changes Changed: U Zope/branches/rochael-TM_sortKey/doc/CHANGES.rst -=- Modified: Zope/branches/rochael-TM_sortKey/doc/CHANGES.rst === --- Zope/branches/rochael-TM_sortKey/doc/CHANGES.rst2010-06-18 18:27:43 UTC (rev 113620) +++ Zope/branches/rochael-TM_sortKey/doc/CHANGES.rst2010-06-18 19:04:36 UTC (rev 113621) @@ -38,6 +38,10 @@ - Missing = 2.13.1 - Persistence = 2.13.2 +- Added setSortKey() method to the Shared.DC.ZRDB.TM.TM class + to allow database connections to specify the commit order without + needing to override the sortKey() method. + 2.12.7 (2010-06-13) --- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.12/ merge branch rochael-TM_sortKey: add a setSortKey method to Shared.setSortKey() method to Shared.DC.ZRDB.TM.TM
Log message for revision 113622: merge branch rochael-TM_sortKey: add a setSortKey method to Shared.setSortKey() method to Shared.DC.ZRDB.TM.TM Changed: U Zope/branches/2.12/doc/CHANGES.rst U Zope/branches/2.12/src/Shared/DC/ZRDB/TM.py A Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py -=- Modified: Zope/branches/2.12/doc/CHANGES.rst === --- Zope/branches/2.12/doc/CHANGES.rst 2010-06-18 19:04:36 UTC (rev 113621) +++ Zope/branches/2.12/doc/CHANGES.rst 2010-06-18 19:18:30 UTC (rev 113622) @@ -38,6 +38,10 @@ - Missing = 2.13.1 - Persistence = 2.13.2 +- Added setSortKey() method to the Shared.DC.ZRDB.TM.TM class + to allow database connections to specify the commit order without + needing to override the sortKey() method. + 2.12.7 (2010-06-13) --- Modified: Zope/branches/2.12/src/Shared/DC/ZRDB/TM.py === --- Zope/branches/2.12/src/Shared/DC/ZRDB/TM.py 2010-06-18 19:04:36 UTC (rev 113621) +++ Zope/branches/2.12/src/Shared/DC/ZRDB/TM.py 2010-06-18 19:18:30 UTC (rev 113622) @@ -26,7 +26,7 @@ needed at the start of a transaction. A subclass that uses locking during transaction commit must -defined a sortKey() method. +define a sortKey() method. _registered=None @@ -66,14 +66,19 @@ tpc_abort = abort +# Most DA's talking to RDBMS systems do not care about commit order, so +# return the constant 1 +_sort_key = 1 + def sortKey(self, *ignored): - The sortKey method is used for recent ZODB compatibility which -needs to have a known commit order for lock acquisition. Most -DA's talking to RDBMS systems do not care about commit order, so -return the constant 1 + The sortKey method is used by ZODB to have a known commit order for +lock acquisition. -return 1 +return self._sort_key +def setSortKey(self, sort_key): +self._sort_key = sort_key + class Surrogate: def __init__(self, db): Copied: Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py (from rev 113621, Zope/branches/rochael-TM_sortKey/src/Shared/DC/ZRDB/tests/testTM.py) === --- Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py (rev 0) +++ Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py 2010-06-18 19:18:30 UTC (rev 113622) @@ -0,0 +1,29 @@ +## +# +# Copyright (c) 2009 Zope Foundation and Contributors. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE +# +## + +from unittest import TestCase, TestSuite, makeSuite +from Shared.DC.ZRDB.TM import TM + +class TestTM(TestCase): + +def test_sortKey(self): +tm = TM() +# the default Transaction Manager should have .sortKey() of 1 for +# backward compatibility +self.assertEquals(tm.sortKey(), 1) +# but the sortKey() should be adjustable +tm.setSortKey(()) +self.assertEquals(tm.sortKey(), ()) + +def test_suite(): +return TestSuite((makeSuite(TestTM),)) ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/ merge branch rochael-TM_sortKey: add a setSortKey method to Shared.setSortKey() method to Shared.DC.ZRDB.TM.TM
Log message for revision 113623: merge branch rochael-TM_sortKey: add a setSortKey method to Shared.setSortKey() method to Shared.DC.ZRDB.TM.TM Changed: U Zope/trunk/doc/CHANGES.rst U Zope/trunk/src/Shared/DC/ZRDB/TM.py A Zope/trunk/src/Shared/DC/ZRDB/tests/testTM.py -=- Modified: Zope/trunk/doc/CHANGES.rst === --- Zope/trunk/doc/CHANGES.rst 2010-06-18 19:18:30 UTC (rev 113622) +++ Zope/trunk/doc/CHANGES.rst 2010-06-18 19:33:34 UTC (rev 113623) @@ -145,6 +145,10 @@ - ZCTextIndex query parser treats fullwidth space characters defined in Unicode as valid white space. +- Added ``setSortKey()`` method to the ``Shared.DC.ZRDB.TM.TM`` class + to allow database connections to specify the commit order without + needing to override the ``sortKey()`` method. + - Updated packages: - Jinja2 = 2.5.0 Modified: Zope/trunk/src/Shared/DC/ZRDB/TM.py === --- Zope/trunk/src/Shared/DC/ZRDB/TM.py 2010-06-18 19:18:30 UTC (rev 113622) +++ Zope/trunk/src/Shared/DC/ZRDB/TM.py 2010-06-18 19:33:34 UTC (rev 113623) @@ -26,7 +26,7 @@ needed at the start of a transaction. A subclass that uses locking during transaction commit must -defined a sortKey() method. +define a sortKey() method. _registered=None @@ -66,14 +66,19 @@ tpc_abort = abort +# Most DA's talking to RDBMS systems do not care about commit order, so +# return the constant 1 +_sort_key = 1 + def sortKey(self, *ignored): - The sortKey method is used for recent ZODB compatibility which -needs to have a known commit order for lock acquisition. Most -DA's talking to RDBMS systems do not care about commit order, so -return the constant 1 + The sortKey method is used by the transaction subsystem to have a +known commit order for lock acquisition. -return 1 +return self._sort_key +def setSortKey(self, sort_key): +self._sort_key = sort_key + class Surrogate: def __init__(self, db): Copied: Zope/trunk/src/Shared/DC/ZRDB/tests/testTM.py (from rev 113621, Zope/branches/rochael-TM_sortKey/src/Shared/DC/ZRDB/tests/testTM.py) === --- Zope/trunk/src/Shared/DC/ZRDB/tests/testTM.py (rev 0) +++ Zope/trunk/src/Shared/DC/ZRDB/tests/testTM.py 2010-06-18 19:33:34 UTC (rev 113623) @@ -0,0 +1,30 @@ +## +# +# Copyright (c) 2010 Zope Foundation and Contributors. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE +# +## + +from unittest import TestCase, TestSuite, makeSuite +from Shared.DC.ZRDB.TM import TM + +class TestTM(TestCase): + +def test_sortKey(self): +tm = TM() +# the default Transaction Manager should have .sortKey() of 1 for +# backward compatibility +self.assertEquals(tm.sortKey(), 1) +# but the sortKey() should be adjustable +tm.setSortKey(()) +self.assertEquals(tm.sortKey(), ()) + +def test_suite(): +return TestSuite((makeSuite(TestTM),)) + ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.12/ ReST changes, and it's a new year already
Log message for revision 113624: ReST changes, and it's a new year already Changed: U Zope/branches/2.12/doc/CHANGES.rst U Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py -=- Modified: Zope/branches/2.12/doc/CHANGES.rst === --- Zope/branches/2.12/doc/CHANGES.rst 2010-06-18 19:33:34 UTC (rev 113623) +++ Zope/branches/2.12/doc/CHANGES.rst 2010-06-18 19:38:08 UTC (rev 113624) @@ -38,9 +38,9 @@ - Missing = 2.13.1 - Persistence = 2.13.2 -- Added setSortKey() method to the Shared.DC.ZRDB.TM.TM class +- Added ``setSortKey()`` method to the ``Shared.DC.ZRDB.TM.TM`` class to allow database connections to specify the commit order without - needing to override the sortKey() method. + needing to override the ``sortKey()`` method. 2.12.7 (2010-06-13) --- Modified: Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py === --- Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py 2010-06-18 19:33:34 UTC (rev 113623) +++ Zope/branches/2.12/src/Shared/DC/ZRDB/tests/testTM.py 2010-06-18 19:38:08 UTC (rev 113624) @@ -1,6 +1,6 @@ ## # -# Copyright (c) 2009 Zope Foundation and Contributors. +# Copyright (c) 2010 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope-dev] connection commit ordering
On 18 June 2010 01:24, Leonardo Rochael Almeida leoroch...@gmail.com wrote: By the way, this issue is completely separate from the two-phase-commit discussion that we had recently, since all the connectors involved here are fully transactional. As you can see here: http://zope3.pov.lt/trac/browser/Zope/trunk/src/Shared/DC/ZRDB/TM.py def tpc_vote(self, *ignored): self._finalize = 1 def tpc_finish(self, *ignored): if self._finalize: try: self._finish() finally: self._registered=0 The transaction manager is only doing one phase commit. It sorts first as it commits in the second phase. If you change the sort order, you lose the guarantee of transactional integrity. Perhaps a better way to solve this would be to include the zope transaction id in the table, then in the background thread only reindex the queued items with a tid = the current tid of the connection. Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Tests: 28 OK, 10 Failed
Summary of messages to the zope-tests list. Period Thu Jun 17 12:00:00 2010 UTC to Fri Jun 18 12:00:00 2010 UTC. There were 38 messages: 6 from Zope Tests, 11 from ccomb at free.fr, 5 from ct at gocept.com, 16 from jdriessen at thehealthagency.com. Test failures - Subject: FAILED : Total languishing bugs: 1 From: ct at gocept.com Date: Thu Jun 17 20:30:17 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015413.html Subject: FAILED : Total languishing bugs: 103 From: ct at gocept.com Date: Thu Jun 17 20:36:17 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015414.html Subject: FAILED : Total languishing bugs: 178 From: ct at gocept.com Date: Thu Jun 17 20:41:08 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015415.html Subject: FAILED : Total languishing bugs: 75 From: ct at gocept.com Date: Thu Jun 17 20:45:29 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015416.html Subject: FAILED: Repository policy check found errors in 453 projects From: ct at gocept.com Date: Thu Jun 17 21:10:26 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015417.html Subject: FAILED : BlueBream template / Python2.4.6 32bit linux From: ccomb at free.fr Date: Thu Jun 17 22:00:58 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015423.html Subject: FAILED : BlueBream template / Python2.5.2 32bit linux From: ccomb at free.fr Date: Thu Jun 17 22:01:01 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015424.html Subject: FAILED : BlueBream template / Python2.6.4 32bit linux From: ccomb at free.fr Date: Thu Jun 17 22:01:01 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015425.html Subject: FAILED : Zope 3.4.1 KGS / Python2.4.6 32bit linux From: ccomb at free.fr Date: Fri Jun 18 00:28:50 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015430.html Subject: FAILED : Zope Buildbot / ztk_win slave-win From: jdriessen at thehealthagency.com Date: Fri Jun 18 07:22:59 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015442.html Tests passed OK --- Subject: OK : Zope Buildbot / zope2.12 slave-osx From: jdriessen at thehealthagency.com Date: Thu Jun 17 08:52:11 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015407.html Subject: OK : Zope Buildbot / zope2 slave-ubuntu64 From: jdriessen at thehealthagency.com Date: Thu Jun 17 08:54:45 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015408.html Subject: OK : Zope Buildbot / zope2 slave-ubuntu32 From: jdriessen at thehealthagency.com Date: Thu Jun 17 08:54:51 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015409.html Subject: OK : Zope Buildbot / zope2 slave-osx From: jdriessen at thehealthagency.com Date: Thu Jun 17 08:59:43 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015410.html Subject: OK : Zope Buildbot / ztk slave-osx From: jdriessen at thehealthagency.com Date: Thu Jun 17 09:29:03 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015411.html Subject: OK : Zope Buildbot / zope2 slave-osx From: jdriessen at thehealthagency.com Date: Thu Jun 17 09:36:38 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015412.html Subject: OK : Zope-2.10 Python-2.4.6 : Linux From: Zope Tests Date: Thu Jun 17 21:52:28 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015418.html Subject: OK : Zope-2.11 Python-2.4.6 : Linux From: Zope Tests Date: Thu Jun 17 21:54:39 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015419.html Subject: OK : Zope-2.12 Python-2.6.5 : Linux From: Zope Tests Date: Thu Jun 17 21:56:44 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015420.html Subject: OK : Zope-2.12-alltests Python-2.6.5 : Linux From: Zope Tests Date: Thu Jun 17 21:58:54 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015421.html Subject: OK : Zope-trunk Python-2.6.5 : Linux From: Zope Tests Date: Thu Jun 17 22:00:54 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015422.html Subject: OK : Zope-trunk-alltests Python-2.6.5 : Linux From: Zope Tests Date: Thu Jun 17 22:02:54 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015426.html Subject: OK : ZTK 1.0dev / Python2.4.6 Linux 32bit From: ccomb at free.fr Date: Fri Jun 18 00:07:44 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015427.html Subject: OK : ZTK 1.0dev / Python2.5.2 Linux 32bit From: ccomb at free.fr Date: Fri Jun 18 00:09:00 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015428.html Subject: OK : ZTK 1.0dev / Python2.6.4 Linux 32bit From: ccomb at free.fr Date: Fri Jun 18 00:09:05 EDT 2010 URL: http://mail.zope.org/pipermail/zope-tests/2010-June/015429.html Subject: OK : Zope 3.4.1 KGS / Python2.5.2 32bit linux From: ccomb at free.fr Date: Fri Jun 18 00:51:46 EDT 2010 URL:
Re: [Zope-dev] connection commit ordering
Hi Laurence On Fri, Jun 18, 2010 at 08:06, Laurence Rowe l...@lrowe.co.uk wrote: On 18 June 2010 01:24, Leonardo Rochael Almeida leoroch...@gmail.com wrote: By the way, this issue is completely separate from the two-phase-commit discussion that we had recently, since all the connectors involved here are fully transactional. As you can see here: http://zope3.pov.lt/trac/browser/Zope/trunk/src/Shared/DC/ZRDB/TM.py def tpc_vote(self, *ignored): self._finalize = 1 def tpc_finish(self, *ignored): if self._finalize: try: self._finish() finally: self._registered=0 The transaction manager is only doing one phase commit. It sorts first as it commits in the second phase. If you change the sort order, you lose the guarantee of transactional integrity. For me this means that TM subclasses need to override tpc_vote and implement a proper commit preparation [1] [2] to assure they are correctly participating in the TPC dance. And if that is not the case, but you have, for example, more than one MySQL connector, you are already in a situation where you can't guarantee transactional integrity, so this discussion is actually orthogonal to the sortOrder one. Perhaps a better way to solve this would be to include the zope transaction id in the table, then in the background thread only reindex the queued items with a tid = the current tid of the connection. Possibly, but is there a way to know the id of a transaction that hasn't been committed yet, to store it on MySQL? Besides, when working with multiple mount points, you might have to store multiple TIDs, for all storages involved, or else there should be a global transaction ID that should be recorded everywhere, and I don't see the 'transaction' package providing one. In any case, does anyone oppose the existence of a .setSortKey() on the TM class? Cheers, Leo [1] http://www.postgresql.org/docs/current/static/sql-prepare-transaction.html [2] http://dev.mysql.com/doc/refman/5.0/en/xa.html ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] connection commit ordering
On Fri, Jun 18, 2010 at 10:55, Hanno Schlichting ha...@hannosch.eu wrote: On Fri, Jun 18, 2010 at 3:32 PM, Leonardo Rochael Almeida leoroch...@gmail.com wrote: In any case, does anyone oppose the existence of a .setSortKey() on the TM class? Your branch looks simple enough. Feel free to merge it to Zope trunk but don't forget to add a change entry in doc/CHANGES.rst Thanks. Can I commit it to Zope 2.12 as well? It is backward compatible and helps us address a bug we see on production. Cheers, ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] connection commit ordering
On Fri, Jun 18, 2010 at 4:29 PM, Leonardo Rochael Almeida leoroch...@gmail.com wrote: Thanks. Can I commit it to Zope 2.12 as well? It is backward compatible and helps us address a bug we see on production. Go ahead. It really is trivial :) Hanno ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Bug day report
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roman Joost wrote: On Thu, Jun 17, 2010 at 07:59:18AM -0400, Tres Seaver wrote: Roman, I landed my version of the fix in 'zope.testrunner', but didn't touch it in 'zope.testing', since you were working on it. I was rushing a little because I wanted to release 'zope.testrunner', but wanted to check with you first. The patch is here: http://svn.zope.org/zope.testrunner/trunk/src/zope/testrunner/find.py?rev=113540view=diffr1=113540r2=113539p1=zope.testrunner/trunk/src/zope/testrunner/find.pyp2=/zope.testrunner/trunk/src/zope/testrunner/find.py I'm fine with letting you land it in zope.testing, or even tweak it on the zope.testruner side, if you see a better fix. Thank you. I actually had troubles running all tests in zope.testrunner. I need to check why to be sure, to avoid commiting something broken. Marius fixed the buildout for that. I usually prefer to let someone more experienced review my code, although it seems to be not worth it for this little fix. So to clarify - can I commit the patch to zope.testrunner after I verified that the tests are working fine on my local sandbox? You should be able to check in just fine -- do you mean zope.testing, or zope.testrunner? I checked in my changes to zope.testrunner already. Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkwbi6MACgkQ+gerLs4ltQ5mQACg0BejhsCAi8jw696URNPJ/KKh /6cAn0eFmusq+6EIlvSeudv+TdvpcG33 =6IHS -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] connection commit ordering
On 18 June 2010 14:32, Leonardo Rochael Almeida leoroch...@gmail.com wrote: Hi Laurence On Fri, Jun 18, 2010 at 08:06, Laurence Rowe l...@lrowe.co.uk wrote: On 18 June 2010 01:24, Leonardo Rochael Almeida leoroch...@gmail.com wrote: By the way, this issue is completely separate from the two-phase-commit discussion that we had recently, since all the connectors involved here are fully transactional. As you can see here: http://zope3.pov.lt/trac/browser/Zope/trunk/src/Shared/DC/ZRDB/TM.py def tpc_vote(self, *ignored): self._finalize = 1 def tpc_finish(self, *ignored): if self._finalize: try: self._finish() finally: self._registered=0 The transaction manager is only doing one phase commit. It sorts first as it commits in the second phase. If you change the sort order, you lose the guarantee of transactional integrity. For me this means that TM subclasses need to override tpc_vote and implement a proper commit preparation [1] [2] to assure they are correctly participating in the TPC dance. zope.sqlalchemy does this, but that brings a whole orm into the equation and does away with ZRDB legacy. And if that is not the case, but you have, for example, more than one MySQL connector, you are already in a situation where you can't guarantee transactional integrity, so this discussion is actually orthogonal to the sortOrder one. That's true, but don't you see this problem even with only a single ZODB and a single ZRDB connection? Perhaps a better way to solve this would be to include the zope transaction id in the table, then in the background thread only reindex the queued items with a tid = the current tid of the connection. Possibly, but is there a way to know the id of a transaction that hasn't been committed yet, to store it on MySQL? Besides, when working with multiple mount points, you might have to store multiple TIDs, for all storages involved, or else there should be a global transaction ID that should be recorded everywhere, and I don't see the 'transaction' package providing one. The ZODB storage's transaction id is set in tpc_begin, so you should be able to get it in tcp_vote or tpc_finish of the ZRDB data manager. Though doing so probably horribly complicates the ZSQLCatalog code. In any case, does anyone oppose the existence of a .setSortKey() on the TM class? I don't oppose it, but I also don't see how this will fix the problem unless you set the sort key to be greater than the ZODB's sort key. This strikes me as a very bad idea for a TM that is designed to tpc_finish before anything else. Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-CMF] How do you add an action in python code?
I have been looking at the Action* related code and have not been able to figure it out completely. I tried portal_actions.addAction(...) but this adds it under the Actions tab with the big RED deprecation warning. I am able to add it from the ZMI correctly, but can't trace the code that does the real adding (Ended up getting lost in GenericSetup browser views). Can someone give me a pointer? Suresh ___ Zope-CMF maillist - Zope-CMF@zope.org https://mail.zope.org/mailman/listinfo/zope-cmf See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests
Re: [Zope-CMF] How do you add an action in python code?
Suresh V. wrote: I have been looking at the Action* related code and have not been able to figure it out completely. I tried portal_actions.addAction(...) but this adds it under the Actions tab with the big RED deprecation warning. I am able to add it from the ZMI correctly, but can't trace the code that does the real adding (Ended up getting lost in GenericSetup browser views). Can someone give me a pointer? There is no special API. ActionCategory inherits from OFS.OrderedFolder, you can use the _setObject method. HTH, Yuppie ___ Zope-CMF maillist - Zope-CMF@zope.org https://mail.zope.org/mailman/listinfo/zope-cmf See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests