RE: [ZODB-Dev] RFC: Pre-commit hooks

2005-04-07 Thread Tim Peters
[Florent Guillaume] I've added the code on a branch off 3.4: http://svn.zope.org/?rev=29885view=rev Could someone check if it's suitable and merge it ? Very nice, Florent -- thank you! I added some stuff (trust me, you won't object wink), and merged it to the 3.4 branch and to the ZODB

RE: [ZODB-Dev] UnpicklingError in Ape 1.0

2005-04-08 Thread Tim Peters
Dtvie, if you don't get a useful response from this (zodb-dev) list, you may have better luck on the zope-db list: http://mail.zope.org/mailman/listinfo/zope-db APE and MySQL are discussed more often there. [Dinh Trung Viet] I had a problem when trying to use Ape 1.0 in Zope 2.7 to store

RE: [ZODB-Dev] Encoded strings as keys for OOBTree in 2.7.3

2005-04-13 Thread Tim Peters
[Chris Withers] Interesting problem with an OOBTree, in this case the _index attribute of a FieldIndex in a Zope 2.7.3 instance. doing self._index.get('tést') (you can get the é by doing Alt Gr - e ;-) resulted in a UnicodeDecodeError. The bizarre thing is that: t = OOBTree()

RE: [ZODB-Dev] ConflictErrors won't clear

2005-04-14 Thread Tim Peters
[Chris Withers] I have a non-zope zeo client that pumps data into a storage server for later consumption by a zope zeo client. Everything is Zope 2.7.5. The non-zope client has logic that looks roughly like: for work in queue: try: get_transaction().begin() # do work, change

RE: [ZODB-Dev] B-Tree Concurrency Issue (_OOBTree.pyd segfaults)

2005-04-16 Thread Tim Peters
I believe I identified one cause for catastrophic thread-race problems here (sharing a Connection across multiple threads, or for any other reason sharing an in-memory persistent object across non-serialized threads), even when objects are never modified. It doesn't look shallow to me. The C

RE: [ZODB-Dev] before commit hook

2005-04-25 Thread Tim Peters
[Florent Guillaume] FYI in CPS we use a simple backport of the before commit hook to ZODB 3.2: http://cvs.nuxeo.org/cgi-bin/viewcvs.cgi/CPS3/CPSCompat/PatchZODBTransactio n.py?rev=1view=markup For now we use it to delay indexing of some objects to the end of the transaction (to avoid

RE: [ZODB-Dev] before commit hook

2005-04-26 Thread Tim Peters
[Tim Peters, on adding getBeforeCommitHooks()] Note that Zope 2.8b1 was already released (yesterday) with a ZODB 3.4 alpha, so strictly speaking no new features should be added to ZODB 3.4. But if you can slam code and tests for this in quickly, I'll look the other way (I think adding

RE: [ZODB-Dev] Invalidations

2005-04-26 Thread Tim Peters
[Rajeev J Sebastian] Is there some means provided by ZODB/Zeo by which I can get notified about changes to certain objects after performing sync() ? There is not. Object state is loaded by calling its __setstate__() method, and you may be able to hack something out of that, but you would need

RE: [ZODB-Dev] Invalidations

2005-04-27 Thread Tim Peters
[Rajeev J Sebastian] Is there some means provided by ZODB/Zeo by which I can get notified about changes to certain objects after performing sync() ? [Tim Peters] There is not. Object state is loaded by calling its __setstate__() method, and you may be able to hack something out

[ZODB-Dev] ZODB 3.2.8 final released

2005-04-27 Thread Tim Peters
I'm pleased to announce the release of ZODB 3.2.8 (final). Also irked, since ZODB 3.2.7 final was released just yesterday. Alas, an incompatible change in 3.2.7's ZopeUndo.Prefix implementation effectively made it impossible to use a 3.2.7 ZEO server with a Zope running a ZODB earlier than

RE: __no_side_effects__, was Re: [ZODB-Dev] Re: [Zodb-checkins] SVN:ZODB/branches/3.4/

2005-04-28 Thread Tim Peters
[Tim Peters] What I seem to be missing entirely here is why Zope ships Prefix instances at the base ZEO msg level to begin with; maybe it's to call some method I misunderstand (or haven't even bumped into yet 0.6 wink). [Shane Hathaway] When you want to undo something, Zope asks the ZEO

RE: [ZODB-Dev] python restricted mode subthreads bug

2005-04-30 Thread Tim Peters
[John Belmonte] I'm wondering if someone on the list able to pull some python-dev strings would be kind enough to raise the priority of Python bug 1163563. This is the one causing ZEO not to work with mod_python in Python 2.3.5 and later. The only one likely to work on that is Mark Hammond,

RE: [ZODB-Dev] historicalRevision for subobjects

2005-05-02 Thread Tim Peters
[Christian Heimes] ... Christian Theune and me have implemented a diffed history feature for Archetypes based content types. It's part of ATContentTypes and is meant to help reviewers to see the differences between different revisions of an object. The code is using the method

RE: [ZODB-Dev] setup.py --clean issue

2005-05-02 Thread Tim Peters
[John Belmonte] In 3.4a1 I noticed that setup.py --clean is leaving some derived files behind: ... I opened a bug report for this. Followups there, please. I didn't even know setup.py had a clean argument. http://www.zope.org/Collectors/Zope/1769

RE: [ZODB-Dev] ZODB.POSException.ReadConflictError

2005-05-03 Thread Tim Peters
[EMAIL PROTECTED] I'm getting a ZODB.POSException.ReadConflictError on my Plone 2.0.5 site (Zope 2.7.3, Python 2.3.4 on Mac OS X Server 10.3.9). It happens most frequently when members try to register on my site (about 10% of the time), but occasionally happens when other pages are accessed

RE: [ZODB-Dev] Indexing: Query Optimization

2005-05-03 Thread Tim Peters
[Thomas Guettler] I developed a simple index using ZODB. Searching for single values is very fast. Searching big ranges is slow. Example: Search: customer_id=0815 date_start=2001-01-01 date_end=2004-12-31 The index holds a btree which maps values to docids. The search for customer_id is

RE: [ZODB-Dev] Commit/abort before connection close required?

2005-05-03 Thread Tim Peters
[Stefan H. Holek] I found that I now need to explicitly abort (or commit) the transaction before closing a connection, Only if changes are still pending to objects loaded from that connection. Example: import ZODB from ZODB.FileStorage import FileStorage st = FileStorage(Temp.fs) db =

RE: [ZODB-Dev] historicalRevision for subobjects

2005-05-04 Thread Tim Peters
[Christian Heimes] I had the idea of getting a snapshot of the entire ZODB for a given transaction serial number but I don't know how to get it. Is this possible? ... [Dieter Maurer] It is possible (by means of a historical connection) and I posted relevant code some time ago. Search the

RE: [ZODB-Dev] zdctl.py --umask bug

2005-05-04 Thread Tim Peters
[John Belmonte] One year later, this is still a bug. As I'm the one that added the umask option in the first place, can I ask that you trust me and apply the one line fix? http://www.zope.org/Collectors/Zope/1323 You should add that as a comment to the collector issue. zdaemon happens to

RE: [ZODB-Dev] Invalidations

2005-05-05 Thread Tim Peters
[Shane Hathaway] Would it be sensible for ZODB to do the equivalent of sync() when users call transaction.begin()? That's what I tend to expect it to do anyway--it takes some effort to remember that it doesn't. [Jim Fulton] Yes, or commit, or abort. That's what Tim and I were pondering in a

RE: [ZODB-Dev] Invalidations

2005-05-05 Thread Tim Peters
[Tim Peters] ... AFAICT, it would make more sense to move the logic for invoking callbacks into TransactionManager. Transaction() currently takes an optional `sychronizers` argument that it never mutates, for which a TransactionManager always passes its set of registered synchronizers

RE: [ZODB-Dev] ZODB memory problems

2005-05-31 Thread Tim Peters
... [Toby Dickenson] pb; perspective broker. I thought that suggestion was crazy when Jeremey first presented it in his blog, but increasing exposure to other twisted tools makes it seem more reasonable. Just thought I'd guess at the probably-intended references:

RE: [ZODB-Dev] CorruptedDataError sniff !

2005-06-02 Thread Tim Peters
[Eric Brun, with a corruption problem] This is a good place to discuss it, but I can't tell you more here than I said on zope-dev earlier this morning: http://mail.zope.org/pipermail/zope-dev/2005-June/024941.html ... I have tried to do a fsrecover, it removes a transaction. ... fstest say

RE: [ZODB-Dev] ZODB 3.4 and Persistence

2005-06-02 Thread Tim Peters
[Kevin Dangoor] I'm working with the ZODB 3.4 beta, and I'm working on getting Catalog running with it. I noticed that the _Persistence module is not being built. Is this because ExtensionClass is not included and _Persistence requires ExtensionClass? Catalog has a couple of acquisition

RE: [ZODB-Dev] ZODB 3.4 and Persistence

2005-06-02 Thread Tim Peters
[Tim Peters] ... Hmm. _Persistence.c should be removed from ZODB. Zope 2.8 has its own copy now, in its lib/python/Persistence/ directory. Sorry, I lied about that part. Zope 2.8 copies its Persistence directory from ZODB, so _Persistence.c can't be removed from ZODB yet. Grr -- which

RE: [ZODB-Dev] [Proposal] Size controlled ZODB cache

2005-06-03 Thread Tim Peters
[Michel Pelletier] ... I have some performance experiences from this that'd I'd love to share if I ever had the time, which I might soon, but for now I have no hard numbers so I won't elaborate on the cache issue being the cause, but increasing the cache size has a definite improvement in

RE: [ZODB-Dev] [Proposal] Size controlled ZODB cache

2005-06-03 Thread Tim Peters
[Chris Withers] I don't suppose there's any way that, as part of this work, the size of the cache could also be limited DURING a transaction? ... That didn't look like part of Dieter's proposal to me wink. It carries its own risks, and I'd rather not tie them together. For example, _v_

RE: [ZODB-Dev] Generational Caching

2005-06-07 Thread Tim Peters
[Chris McDonough] One way to potentially soften the impact of cache busting by spiders might be to allow Zope to choose a particular ZODB connection based on request parameters (like sessionid or requesting ip address, or most likely user agent in the case of legitimate spiders). This is a

RE: [ZODB-Dev] Generational Caching

2005-06-08 Thread Tim Peters
[Dieter Maurer] But with 32 bit addresses, a single process cannot use more than 4GB RAM. I expect that BIOS and/or OS often don't even allow that (e.g., user-space VM addresses are limited to 31 bits in Win32). I started working on 64-bit machines in the late 70's, so it's hard to believe that

RE: [ZODB-Dev] ZEO client hangs when combined with other asyncore code

2005-06-21 Thread Tim Peters
[EMAIL PROTECTED] We have an application that makes use of a ZEO client and has other async socket code that implements as POP3 proxy. The ZEO client is called (to query and store ZEO server) from within the proxy code when it runs during mail checks, so we have multiple async connections at

RE: [ZODB-Dev] ZEO client hangs when combined with other asyncore code

2005-06-21 Thread Tim Peters
... [Tim Peters] asyncore gives me a headache. [Paul Boots] Same here Then it's time to admit that ZEO's attempts to mix threads with asyncore give me migraine headaches 0.5 wink. I wonder whether this could be the problem: Paul said he's calling ZEO from within the proxy code

RE: [ZODB-Dev] ZEO client hangs when combined with other asyncore code

2005-06-23 Thread Tim Peters
... [Tim Peters] asyncore gives me a headache. [Tony Meyer] I think this is true for any value of me 0.5 wink. Not Sam Rushing -- he's asyncore's dad. He doesn't use threads, and, for that matter, doesn't use asyncore anymore either (possibly because it isn't confusing enough wink

RE: [ZODB-Dev] TmpStore missing loadBefore

2005-06-26 Thread Tim Peters
[Sidnei da Silva] We've hit a case where loadBefore would get called on TmpStore during plone.org migration. Unfortunately TmpStore doesn't implement loadBefore. There seems to be no tests for this. I tried to write one and provide a fix but just occurred me that TmpStore tries to be a

RE: [ZODB-Dev] TmpStore missing loadBefore

2005-06-26 Thread Tim Peters
[Sidnei da Silva] There's a collector issue open against ZODB 3.3 [Issue 5166], but the bug is still present in 3.4 and trunk. Can you be more specific, then? As I pointed out last time, rev 30825 attempted to delegate loadBefore, and the new test for it passes (but failed before the change

RE: [ZODB-Dev] TmpStore missing loadBefore

2005-06-26 Thread Tim Peters
[Tim Peters] This was fixed a few weeks [ago], in rev 30825: http://svn.zope.org/ZODB/branches/3.4/?rev=30825view=rev [Sidnei da Silva] Ah, there we go. So that was fixed after 3.4.0 was tagged, and Zope 2.8 branch still points to the 3.4.0 tag. All correct! Guess we need a new tag

RE: Re: [ZODB-Dev] Handling more databases with zeo

2005-06-28 Thread Tim Peters
[Lukas Linhart] ... Well I meant: when I'm having ZEO configured this way (/etc/zeo/zeo.conf): zeo address localhost:11000 monitor-address localhost:11001 /zeo filestorage 1 path /var/www/databases/zodb/almad-net.fs /filestorage filestorage 2 path

[ZODB-Dev] Zope 2.8.1 (was RE: TmpStore missing loadBefore)

2005-06-29 Thread Tim Peters
[Andreas Jung] The Plone guys asked about a 2.8.1 release for end of July/start of August which should not be a problem. Since they are working on making Plone 2.1 work with Zope 2.8 there is a good chance that further bugs show up which should be fixed for 2.8.1. So 2.8.1 b1 could be released

RE: [ZODB-Dev] Handling more databases with zeo

2005-06-29 Thread Tim Peters
[Tim Peters] As before, I'd run a different ZEO server for each database.  I'm not sure that what you're doing here will be supported for much longer (or really even _is_ supported anymore -- see my last msg). [Lukas Linhart] Well, I'm stuck on zodb 3.2.x line because I'm using IndexedCatalog

RE: Re: [ZODB-Dev] Handling more databases with zeo

2005-06-29 Thread Tim Peters
[Tim Peters] As before, I'd run a different ZEO server for each database. I'm not sure that what you're doing here will be supported for much longer (or really even _is_ supported anymore -- see my last msg). [Dieter Maurer] I do not know whether it is supported but it works in ZODB

RE: Re: [ZODB-Dev] Handling more databases with zeo

2005-06-29 Thread Tim Peters
[Chris McDonough] I also use this feature but I would be happy to stop using it if it made the code materially simpler to maintain. I don't hate the feature, but I hate that it's undocumented, and I hate that it's untested. I particularly hate that the ClientStorage constructor has 17

RE: [ZODB-Dev] tcp_begin in tests

2005-07-06 Thread Tim Peters
[Antonio Beamud Montero] In my app, I'm using ZODB to store data, the problem is that I have implemented several unittest, for every unit test I create the ZODB database and when the test finished I destroy the database (including files). When I run 2 test, the first is executed ok, but the

RE: [ZODB-Dev] tcp_begin in tests [SOLVED]

2005-07-07 Thread Tim Peters
[Antonio Beamud Montero] Solved... well, as you can see in the traceback, the zope-ZODB library was in the path, and I want using the ZODB alone installed in the python lib path... I've removed the /opt/zope/lib/python from my app pythonpath, and now all works fine... Great! I'm especially

[ZODB-Dev] ZODB 3.2.9 final released

2005-07-08 Thread Tim Peters
I'm pleased to announce the release of ZODB 3.2.9 (final). This corresponds to the ZODB (and ZEO) that will ship with Zope 2.7.7 (final) this coming weekend. In addition to minor bugfixes, there is one critical bugfix in 3.2.9, concerning data consistency after a subtransaction commit. This was

RE: [ZODB-Dev] How expensive are savepoints?

2005-07-09 Thread Tim Peters
[Christian Heimes] How expensive and costly are savepoints? 6, maybe 6.2, depending on the units you're using wink. Seriously, how can such a question be answered? How expensive is math.log()? I wasn't able to find informations about it in the Zope docs. Savepoints are very new, and AFAIK

RE: [ZODB-Dev] Re: How expensive are savepoints?

2005-07-10 Thread Tim Peters
[Christian Heimes] How expensive and costly are savepoints? [Tim Peters] 6, maybe 6.2, depending on the units you're using wink. Seriously, how can such a question be answered? How expensive is math.log()? [Christian] My professor for numerical mathmatics would say it is very expensive

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-11 Thread Tim Peters
[Christian Heimes] Today I stumbled over an unexpected behavior of savepoints. As far as I'm able to understand savepoints they mark a well defined state in the middle of a transaction. Right. A savepoint is invalid if its transaction is committed Right -- or aborted. or another savepoint

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-11 Thread Tim Peters
[Tim Peters] ... OTOH, the transaction.Savepoint.rollback() implementation is a bit schizophrenic: it invalidates self, but leaves it in the transaction's stack (for savepoints after self, it both invalidates them and removes them from the transaction's stack). Oops! Not true. It does

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-11 Thread Tim Peters
[Christian Heimes] ... From my point of view I can't see a reason why the ZODB forbids a second rolback to the savepoint. [Jim Fulton] I agree. This should be changed. Sounds good to me -- it looks easy, so I'll do it wink. ___ For more

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-11 Thread Tim Peters
[Christian Heimes] From my point of view I can't see a reason why the ZODB forbids a second rolback to the savepoint. [Jim Fulton] I agree. This should be changed. [Tim Peters] Sounds good to me -- it looks easy, so I'll do it wink. Something subtler than I've been able to figure out yet

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-11 Thread Tim Peters
[Tim Peters] Something subtler than I've been able to figure out yet is going wrong, so I made a tim-savepoint branch. All the tests pass, but ... Br. The pickle cache invalidate method (which is coded in C, so isn't visible from pdb) clears the dictionary passed to it, and when using

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-11 Thread Tim Peters
[Tim Peters] ... The good news is that, while it was hard to find, it's a one-line repair. Alas, that wasn't the end of it either. I think I'm at the end now, and all the tests are passing again (including new tests to provoke new problems I found). A savepoint (of the data manager Connection

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-12 Thread Tim Peters
[Jeremy Hylton] IIRC, the old implementation of savepoints kept a copy of the index at the time the savepoint was taken so that you could rollback to it multiple times. I don't think there's any way to avoid such a copy. Right, and the current implementation did that too. The surprise was

RE: [ZODB-Dev] Re: Savepoints are invalidated once they are used

2005-07-12 Thread Tim Peters
[Christian Heimes, suggests changing Transaction.commit() to start with if subtransaction: # TODO deprecate subtransactions self._subtransaction_savepoint = self.savepoint(1) return if self._savepoint2index:

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-12 Thread Tim Peters
[Jeremy Hylton] I understand. The further invariant is that the index captured when a savepoint created is immutable. Or at least acts like it. Copying is an easy-to-code and effective way to ensure that, and I don't know of a better feasible way. Capturing a lot of savepoints (or doing a

RE: [ZODB-Dev] Re: Savepoints are invalidated once they are used

2005-07-12 Thread Tim Peters
[Tim Peters] ... I'm not sure I follow this: old code could not be using savepoints directly, so what would break in code that stuck solely to subtxn commits? ... So I don't see how backward compatibility would be injured. BTW, I tried it, and all the ZODB tests pass with this change

RE: [ZODB-Dev] Re: Savepoints are invalidated once they are used

2005-07-12 Thread Tim Peters
[Jim Fulton] A good community project would be to convert all of the subtransaction calls in Zope to savepoint calls. [Christian Heimes] Done I found commit(1) in Zope3 zope.app.file.file Pdata handling and in code and tests in Zope2. Bless you! Alas, I haven't received any messages from

RE: [ZODB-Dev] Reloading product in 2.8

2005-07-12 Thread Tim Peters
[Victor Safronovich, having problems with auto refresh] Victor (et alia), I think a discussion of auto-refresh would be more useful on a Zope list -- it's not really (AFAIK) a ZODB issue. This is what changed in ZODB, from ZODB 3.3c1's NEWS file (and no, it won't be changed back to the way it

RE: [ZODB-Dev] zodb connection question

2005-07-12 Thread Tim Peters
[Jürgen Herrmann] ... so, what i need is a way to have my mechanism called before transaction commits (would be possible to use the hooks provided by zodb 3.4 for that, sure) and cycle through all modified objects (that's where the hooks in 3.4 are not enough for me, they don't provide any way

RE: [ZODB-Dev] zodb connection question

2005-07-13 Thread Tim Peters
[Jürgen Herrmann] hmm, as it seemed quite impossible the way i wanted it, i almost dropped it from my wishlist. now you say, it's doable... It would be possible to add new official APIs to ZODB to supply some notion of the collection of all modified objects, at the level ZODB sees objects. Of

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-14 Thread Tim Peters
[Jeremy Hylton] IIRC, the old implementation of savepoints kept a copy of the index at the time the savepoint was taken so that you could rollback to it multiple times. I don't think there's any way to avoid such a copy. [Dieter Maurer] Maybe, we keep the original implementation (a savepoint

RE: [ZODB-Dev] Reloading product in 2.8

2005-07-14 Thread Tim Peters
[Jim Fulton] It [reload] also doesn't handle global data properly. It tries to do something that Python modules were never designed to support, which is to load them more than once. [Shane Hathaway] However, given the existence of the reload() builtin, someone apparently believed Python

RE: [ZODB-Dev] Savepoints are invalidated once they are used

2005-07-15 Thread Tim Peters
[Dieter] If we do, we can (usually) create a one with the state after the restore. [Tim] Sorry, I couldn't follow that sentence. [Dieter] After I have restored to a savepoint s, then the current state is the one saved in s, thus the sequence: s.restore() # and eliminate from stack

RE: [ZODB-Dev] tweaking invalidation-queue-size

2005-08-02 Thread Tim Peters
[Paul Winkler] invalidation-queue-size is described in ZEO/component.xml like so: The storage server keeps a queue of the objects modified by the last N transactions, where N == invalidation_queue_size. This queue is used to speed client cache verification when a

RE: [ZODB-Dev] zodb-3.4.0 leaks ZEO.cache.Entry objects?

2005-08-03 Thread Tim Peters
[Chris Bainbridge] After some time of running it seems that my process has a lot of ZEO.cache.Entry objects around... sys.getrefcount reports a huge number of references To what was sys.getrefcount() applied? Which version of Python are you using? (155989 when I only have 625 object

RE: [ZODB-Dev] zodb-3.4.0 leaks ZEO.cache.Entry objects?

2005-08-03 Thread Tim Peters
[Tim] ... If you have (or can create) a small, self-contained script showing the problem, that would be the most effective way to make progress. Hmm! This appears to be enough: import sys import random import logging logging.basicConfig() import ZODB from ZODB.config import

RE: [ZODB-Dev] zodb-3.4.0 leaks ZEO.cache.Entry objects?

2005-08-04 Thread Tim Peters
[Tim Peters] The refcount on Entry keeps growing. I suspect, but don't yet know, that this is because FileCache._makeroom()'s should have another line: if e is not None: del self.key2entry[e.key] self._evictobj(e, size) [Chris Bainbridge] I

RE: [ZODB-Dev] Setting the jar

2005-08-04 Thread Tim Peters
[Florent Guillaume] Trying to understand some code... What part of the transaction/persistence code sets the _p_jar of a persistent object to that of its parent when the object is assigned to a persistent parent and transaction.commit(1) is called ? I'm massively overloaded today, so it

RE: [ZODB-Dev] Old persistence/transaction code

2005-08-04 Thread Tim Peters
[Florent Guillaume] Can someone confirm or infirm the fact that __inform_commit__, __inform_abort__, __load__ and __save__ methods are totally obsolete with the current transaction/persistence machinery? They still appear in a number of places, like Shared/DC/ZRDB/TM.py They are still

RE: [ZODB-Dev] Setting the jar

2005-08-04 Thread Tim Peters
[Florent Guillaume] What part of the transaction/persistence code sets the _p_jar of a persistent object to that of its parent when the object is assigned to a persistent parent and transaction.commit(1) is called ? [Tim] I'm massively overloaded today, so it would really help if you could

RE: [ZODB-Dev] Ordering before commit hooks

2005-08-06 Thread Tim Peters
[Julien Anguenot] ... To make it clear the idea is if you got this and if we call it order. Callback Ca order 0 Callback Cb order 99 Callback Cc order -99 The order of execution will be Cc Ca and then Cb. Note the ones with a default order (e.g : 0) will be executed in the order

RE: [ZODB-Dev] Re: SVN: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/ Implements the ordering of before commit subscribers :

2005-08-08 Thread Tim Peters
[Julien Anguenot] +def beforeCommitHookOrdered(hook, order, *args, **kws): + Register a hook to call before the transaction is committed. ... +Note, a hook __call__() method can't define any 'order' argument since +this one is reserved by this method [Florent Guillaume]

RE: [ZODB-Dev] Re: SVN: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/ Implements the ordering of before commit subscribers :

2005-08-08 Thread Tim Peters
[Julien Anguenot] Zope3 seems to use one (1) underscore as a suffix like in : See for instance this : http://svn.zope.org/Zope3/trunk/src/zope/app/component/metaconfigure.py?rev= 37586view=auto def subscriber(_context, for_=None, factory=None, handler=None, provides=None, permission=None,

[ZODB-Dev] ZODB 3.4.1 final released

2005-08-10 Thread Tim Peters
I'm pleased to announce the release of ZODB 3.4.1 final. This corresponds to the ZODB that will ship in Zope 2.8.1. You can download a source tarball or Windows installer from: http://zope.org/Products/ZODB3.4 Note that there are two Windows installers, for Python 2.3 (2.3.5 is

RE: [ZODB-Dev] Re:SVN: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/Implements the ordering of before commit subscribers :

2005-08-10 Thread Tim Peters
[Julien Anguenot] I renamed those arguments in both methods. How can we solve this 2 methods problem ? Deprecation of the old one ? Or can we live like this ? I think this would leave us in the best state: 1. Deprecate beforeCommitHook(), to be subsumed by #2. 2. Change the name of your new

RE: [ZODB-Dev] Re: SVN: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/_transaction.py Implement the sort and insert using bisect.insort()

2005-08-10 Thread Tim Peters
[Florent Guillaume] Frankly I don't see the point of using bisect if you do a linear pass on the list first. The original code was clearer and was faster. If you had a natural way of getting the index, then why not. But anyway this kind of hook list will have only a few elements in it.

RE: [ZODB-Dev] Re: SVN: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/_transaction.py Implement the sort and insert using bisect.insort()

2005-08-11 Thread Tim Peters
[Florent Guillaume] I guess you could simply store and increment then index as an attribute of the transaction, yes. Right! That's an easy, obviously correct way to do it, and is the one I'd probably do. Another way is to define a little class to hold a hook's info, and give it a __cmp__

RE: [ZODB-Dev]Re:SVN: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/Implementsthe ordering of before commit subscribers :

2005-08-11 Thread Tim Peters
[Julien Anguenot] ok I changed it as you mentionned above + the use of a global index on the transaction for the bisect. Like this the complexity is removed. Thank you again, Julien! It's obviously right now, and that's always a nice place to declare victory wink. For the deprecations, I

RE: [ZODB-Dev] Ordering before commit hooks

2005-08-18 Thread Tim Peters
[Jim Fulton, on Julien's addBeforeCommitHook() change] What is the motivation for this? Can you give any use cases? I'm -1 on this because it adds complexity to something that I think should be simple. It feels like something that is likely to be missused. I do have an open mind though.

[ZODB-Dev] PersistentMapping glitches

2005-08-22 Thread Tim Peters
Collector http://www.zope.org/Collectors/Zope/1873 raises some odd issues. One (although the poster didn't realize this, it's _part_ of their complaint) is that PersistentMapping doesn't play well with the newer Python iteration protocol: from ZODB.PersistentMapping import

RE: [ZODB-Dev] Ordering before commit hooks

2005-08-22 Thread Tim Peters
[Tim] ... Julien provided links to code that already uses the new feature: As an Indexation Manager : http://svn.nuxeo.org/trac/pub/file/CPSCore/trunk/IndexationManager.py As an Event Manager : http://svn.nuxeo.org/trac/pub/file/CPSSubscriptions/trunk/EventManager.py He appears to use

FW: [ZODB-Dev] python types question

2005-08-23 Thread Tim Peters
[fwd'ing private msg, since it appears to have been intended to go to the list] -Original Message- From: Jürgen Herrmann [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 23, 2005 7:31 AM To: Tim Peters Subject: RE: [ZODB-Dev] python types question hi! first of all, thanks to everybody

RE: [ZODB-Dev] Subtransaction backward compatibility

2005-08-23 Thread Tim Peters
[Dieter Maurer] Subtransactions used to be used for two purposes: * ensure that newly created objects get _p_ attributes (especially _p_jar and _p_oid) * release memory in the mid of large transactions (i.e. reading and/or writing large amounts of objects) With ZODB 3.4,

RE: [ZODB-Dev] Ordering before commit hooks

2005-08-24 Thread Tim Peters
[Dieter] Now plug and play comes into play: Assume two packages developped by independent people which all want to control the order of hook execution. [Jim] Do we have evidence that such applications exist? So far, the only example I've seen is one where an application wanted a handler

RE: [ZODB-Dev] BTrees and setdefault

2005-08-26 Thread Tim Peters
[Ruslan Spivak] I just read links sent by Dmitriy and see that people have different views about 'setdefault'. Dmitry proposed, and I asked for use cases. http://mail.zope.org/pipermail/zodb-dev/2004-October/008044.html explains why I doubt setdefault() would be added to the Python core

RE: [ZODB-Dev] BTrees and setdefault

2005-08-26 Thread Tim Peters
[Ruslan Spivak] I'd like to implement 'setdefault' method for BTrees. For me it seems like lacking feature of mapping protocol. It can be of course easily emulated, but Readability counts.(C) :) If there won't be objections regarding this method then i'll try to make this excercise on the

[ZODB-Dev] Setting _p_changed on a ghost

2005-08-26 Thread Tim Peters
In IRC yesterday, Stephan Richter was writing a database migration script that wanted to (re)store the state of every object's current revision. FileStorage in ZODB 3.5 has a new iteration protocol (see NEWS.txt) to deliver current revisions, and the relevant (to _this_ msg) part of Stephen's code

[ZODB-Dev] RE: setdefault branch

2005-08-29 Thread Tim Peters
I'm trying to straighten out the new BTree.setdefault() code, on ZODB/branches/alienoid-btrees_setdefault. Turns out this can't work like Python's dict.setdefault() in all cases. This is why: d = {} d.setdefault(666) d {666: None} That is, the default for the optional ``default`` argument is

[ZODB-Dev] RE: setdefault branch

2005-08-29 Thread Tim Peters
[Tim Peters] ... Proposal: make BTree/Bucket setdefault() a two-argument function (3 if you count ``self`` too). In practice, an explicit default is always passed, and not even in theory could we come up with a sane default-default that works across all tree types. This has been done

RE: [ZODB-Dev] Re: setdefault branch

2005-08-29 Thread Tim Peters
[Tim] ... Nothing else to do, so in the absence of objections I'll merge this to ZODB trunk tomorrow. [Ruslan] Oh, you already did that, cool! Thanks, no objections from my side :) In that case, none from my side either ;-) ___ For more

RE: [ZODB-Dev] Re: setdefault branch

2005-08-29 Thread Tim Peters
[Tim Peters] I'm trying to straighten out the new BTree.setdefault() code, on ZODB/branches/alienoid-btrees_setdefault. Turns out this can't work like Python's dict.setdefault() in all cases. This is why: d = {} d.setdefault(666) d {666: None} [Ruslan Spivak] Yes, currrently

RE: [ZODB-Dev] BTrees and setdefault

2005-08-30 Thread Tim Peters
[Dmitry Vasiliev] Since then I've changed my mind and almost haven't used setdefault(). So now I'm only +0 on the idea. :-) I think pop() is even more useful than setdefault(), I've planned to use it for some persistent queue implementation (based on BTrees). So if setdefault() will be added I

RE: [ZODB-Dev] Re: setdefault branch

2005-08-30 Thread Tim Peters
[Ruslan Spivak] Really, that usage of calling setdefault without explicit default is confusing and useless IMHO too. I just wanted to think about possible solution if someone ever could think about usefulness of setdefault without default, but definitely in that case

RE: [ZODB-Dev] multi-level undo on a single object

2005-08-30 Thread Tim Peters
[Arthur Peters] I want to do the following: commit a change to an object, then commit another. Now I want to undo the second change. Easy: get the tid using undoLog and call undo(tid, transaction.get()). Now the following transactions are in the DB: - Change 1 - Change 2 - Undo change 2

RE: [ZODB-Dev] Re: BTrees and setdefault

2005-08-30 Thread Tim Peters
[Ruslan Spivak] Do you think code for pop() should go into separate branch? I think code for pop() should go on _a_ branch, yes. ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list -

RE: [ZODB-Dev] multi-level undo on a single object

2005-08-30 Thread Tim Peters
[Arthur Peters] Thanks you very much. Hey, we're both named Peters -- you're probably the son I never knew (or vice versa ;-)) I'm still having issues but I'll investigant it myself before I ask anything else. I think I came across as pushy and demanding and I'm sorry. I didn't mean to. I

RE: [ZODB-Dev] BTrees and setdefault

2005-09-01 Thread Tim Peters
[Tim Peters] Since setdefault() is going into ZODB 3.5 (I'm going to merge Ruslan's branch into the trunk today), if anyone hint would like to code up pop() implementations too, I won't object. Overall, I like pop() better than setdefault() too. [Dmitry Vasiliev] Wow, Ruslan already has

RE: [ZODB-Dev] Old memory leak related to the ObjectWriter?

2005-09-01 Thread Tim Peters
[Jeremy Hylton] What version of Python? I believe we added cyclic GC support to picklers to address this problem, That sounds right. but that was probably for Python 2.4. But that doesn't. Cyclic gc wasn't new in 2.4, and for ZODB 3.3 the first release that even had a 2.4 Windows installer

RE: [ZODB-Dev] Re: ZODB 3.5 final released

2005-09-01 Thread Tim Peters
[Ruslan Spivak] Great! BTW, i noted you changed svn:externals for ZODB in Zope 3.1 branch, but not for the trunk, is there any reason, or you will do it lately? Unfortunately, things got done in a wrong order here. ZODB 3.5 final is really closest to ZODB 3.5.0a7, which is earlier than the

RE: [ZODB-Dev] zodb-3.5.0 install : Syntax error on sampletests_i.py

2005-09-13 Thread Tim Peters
/lib/python2.3/site-packages/zope/testi ng/testrunner-ex/sample2/sampletests_i.py to sampletests_i.pyc File usr/lib/python2.3/site-packages/zope/testing/testrunner-ex/sample2/samplete sts_i.py, line 15 importx unittest ^ SyntaxError: invalid syntax ... [Tim Peters] Ah

RE: [ZODB-Dev] afterCommitHook

2005-09-21 Thread Tim Peters
[Victor Safronovich] ... it should be better to add addAfterCommitHook to transaction as in addBeforeCommitHook. [Julien Anguenot] yup it could be really useful to trigger non transactionnal code from there. We might use this in here with our CPSRelation product and the rdf db we are

  1   2   3   >