Re: Re[2]: [ZODB-Dev] lazy BTreeItems

2005-12-09 Thread Andreas Jung
--On 9. Dezember 2005 12:53:25 +0500 Victor Safronovich [EMAIL PROTECTED] wrote: Hello Andreas Jung, Friday, December 9, 2005, 12:17:36 PM, you wrote: AJ That's different from my instance (Zope HEAD): You are right :), i use ZODB 3.1.5. Ok, i try on ZODB 3.4.0 this works. 3.1.5? Must

[ZODB-Dev] Deferred notifing from one thread to another.

2005-12-09 Thread Victor Safronovich
Hello zodb-dev! I have a some problem, and don`t know how to solve it :(. I have a scheduler dispatcher thread with run method def run(self): app = Zope2.bobo_application() try: scheduler = app.unrestrictedTraverse( self.scheduler_path, None ) queue =

[ZODB-Dev] OID length

2005-12-09 Thread Florent Guillaume
I know this has been raised several times in the past, but I'm not sure of all the details... What layer of ZODB, if any, has a restriction that OIDs be 8-byte strings. Is it the persistence module? Or just FileStorage? Also is there a reason (performance, space?) for this restriction, and

Re: [ZODB-Dev] OID length

2005-12-09 Thread Jim Fulton
Florent Guillaume wrote: I know this has been raised several times in the past, but I'm not sure of all the details... What layer of ZODB, if any, has a restriction that OIDs be 8-byte strings. Is it the persistence module? Or just FileStorage? Also is there a reason (performance, space?)

RE: [ZODB-Dev] OID length

2005-12-09 Thread Tim Peters
[Florent Guillaume] I know this has been raised several times in the past, but I'm not sure of all the details... You should believe whatever Jim tells you ;-) What layer of ZODB, if any, has a restriction that OIDs be 8-byte strings. Is it the persistence module? Or just FileStorage?

Re: [ZODB-Dev] OID length

2005-12-09 Thread Jim Fulton
Tim Peters wrote: [Florent Guillaume] I know this has been raised several times in the past, but I'm not sure of all the details... You should believe whatever Jim tells you ;-) Hey, what's the wink for? What layer of ZODB, if any, has a restriction that OIDs be 8-byte strings. Is it

RE: [ZODB-Dev] Deferred notifing from one thread to another.

2005-12-09 Thread Tim Peters
[Victor Safronovich] ... Of course i may write time.sleep( SLEEP_CONSTANT ) before app._p_jar.sync(), but is this a good solution? I can't make time to understand your problem (sorry!), but I can make time to tell you that a bare time.sleep() is almost never a good solution to thread problems.

RE: [ZODB-Dev] OID length

2005-12-09 Thread Tim Peters
... [Tim] You should believe whatever Jim tells you ;-) [Jim] Hey, what's the wink for? I was just flirting with Florent ;-) ... I thought this was settled in: http://mail.zope.org/pipermail/zodb-dev/2005-March/008593.html which also mentions the requirement that oids must have len

Re[2]: [ZODB-Dev] Deferred notifing from one thread to another.

2005-12-09 Thread Victor Safronovich
Hello Tim Peters, Friday, December 9, 2005, 9:18:26 PM, you wrote: TP [Victor Safronovich] ... Of course i may write time.sleep( SLEEP_CONSTANT ) before app._p_jar.sync(), but is this a good solution? TP I can't make time to understand your problem (sorry!) Tim, thank you for your answer.

Re: [ZODB-Dev] OID length

2005-12-09 Thread Florent Guillaume
On 9 Dec 2005, at 16:46, Tim Peters wrote: I'm asking because I'm planning a pretty complex storage layer, which would benefit from more complex OIDs (for instance bigger strings, or tuples of (str, int)). An oid is a low-level implementation thingie, and IMO that's probably not the right

RE: [ZODB-Dev] OID length

2005-12-09 Thread Tim Peters
[Florent Guillaume] Oh I agree, but if my storage (think SQL) has internally other kinds of identifiers, like autoincremented integer primary keys, and several tables depending on object kind, I want to reuse its concepts and pack them into an oid like 'footable_12345'. I probably would not.

Re: [ZODB-Dev] ZEO ClientStorage's use of the asyncore main loop (was [Fwd: Re: [Zope3-dev] Twisted Publisher and Zope 2])

2005-12-09 Thread Shane Hathaway
Jim Fulton wrote: Tim and I have discussed this for some time. We think an asynchronous I/O approach is still appropriate, to handle asynchronous messages from servers to clients, but we need to get away from expecting a server to provide the asyncore main loop needed by ZEO. Rather, ZEO should

Re: [ZODB-Dev] ZEO ClientStorage's use of the asyncore main loop (was [Fwd: Re: [Zope3-dev] Twisted Publisher and Zope 2])

2005-12-09 Thread Jim Fulton
Shane Hathaway wrote: Jim Fulton wrote: Tim and I have discussed this for some time. We think an asynchronous I/O approach is still appropriate, to handle asynchronous messages from servers to clients, but we need to get away from expecting a server to provide the asyncore main loop needed by

Re: [ZODB-Dev] OID length

2005-12-09 Thread Shane Hathaway
Tim Peters wrote: Some auxiliary code would definitely break if they weren't strings. For example, ZEO cache tracing has its own trace-file format, which originally blew up left and right when Shane tried to use it with APE. That got generalized (and, alas, the trace files got bigger) to live

[ZODB-Dev] Re: [Zodb-checkins] SVN: ZODB/trunk/src/persistent/interfaces.py Nail the type of oids, as agreed ; -) to in

2005-12-09 Thread Jeremy Hylton
On 12/9/05, Tim Peters [EMAIL PROTECTED] wrote: Log message for revision 40664: Nail the type of oids, as agreed ;-) to in http://mail.zope.org/pipermail/zodb-dev/2005-March/008593.html Changed: U ZODB/trunk/src/persistent/interfaces.py -=- Modified:

Re: [ZODB-Dev] Re: [Zodb-checkins] SVN: ZODB/trunk/src/persistent/interfaces.py Nail the type of oids, as agreed ; -) to in

2005-12-09 Thread Jim Fulton
Jeremy Hylton wrote: On 12/9/05, Tim Peters [EMAIL PROTECTED] wrote: Log message for revision 40664: Nail the type of oids, as agreed ;-) to in http://mail.zope.org/pipermail/zodb-dev/2005-March/008593.html Changed: U ZODB/trunk/src/persistent/interfaces.py -=- Modified:

[ZODB-Dev] RE: [Zodb-checkins] SVN: ZODB/trunk/src/persistent/interfaces.py Nail the type of oids, as agreed ; -) to in

2005-12-09 Thread Tim Peters
[Jeremy Hylton] A minor point, but it seems like it would make more sense for the storage to choose the id of the root object. The database doesn't actually care what the root is, so long as the storage can return it. You could add a ROOT_OID class attribute to a storage to distinguish the

Re: [ZODB-Dev] Deferred notifing from one thread to another.

2005-12-09 Thread Dieter Maurer
Victor Safronovich wrote at 2005-12-9 14:33 +0500: ... But when T2 still not commiting its transaction, dispatcher not see new element :(. Any transaction will only see committed changes. Only at transaction boundaries will a connection cache be updated for modifications by other transactions.

Re: [ZODB-Dev] lazy BTreeItems

2005-12-09 Thread Dieter Maurer
Victor Safronovich wrote at 2005-12-9 12:05 +0500: Hello zodb-dev! Is this a correct behaviour? from BTrees.IIBTree import IIBTree t = IIBTree(map(None,range(5),range(5))) list(t.keys()) [0, 1, 2, 3, 4] k = t.keys() list(k) [0, 1, 2, 3, 4] del t[0] list(k) [] BUT i = iter(t.keys()) del

RE: [ZODB-Dev] OID length

2005-12-09 Thread Dieter Maurer
Tim Peters wrote at 2005-12-9 10:46 -0500: ... I'm not sure where the code actually relies on stringness The cPickleCache explicitely checks for stringness. Not, that this were necessary. It just does. -- Dieter ___ For more information about ZODB,

RE: [ZODB-Dev] lazy BTreeItems

2005-12-09 Thread Tim Peters
[Victor Safronovich] Hello zodb-dev! Is this a correct behaviour? from BTrees.IIBTree import IIBTree t = IIBTree(map(None,range(5),range(5))) list(t.keys()) [0, 1, 2, 3, 4] k = t.keys() list(k) [0, 1, 2, 3, 4] del t[0] list(k) [] Nothing is defined about what an iterator sees

RE: [ZODB-Dev] OID length

2005-12-09 Thread Tim Peters
[Shane Hathaway] FWIW: Ape still uses variable length strings. That's OK! The OIDs shrank in size because they used to contain the object's physical path, but that turned out to play bad tricks with copy/paste, A cautionary tale about getting too fancy with oids ;-) so now OIDs are usually

Re: [ZODB-Dev] OID length

2005-12-09 Thread Shane Hathaway
Tim Peters wrote: [Shane Hathaway] It can do this because it has to provide its own DB and Connection objects anyway. I trust that's for more reasons than _just_ because it doesn't want to use '\0'*8 as the root-object oid. It's for uniformity. In Ape, the strategy for choosing OIDs is

RE: [ZODB-Dev] ZEO ClientStorage's use of the asyncore main loop (was[Fwd: Re: [Zope3-dev] Twisted Publisher and Zope 2])

2005-12-09 Thread Tim Peters
[Jim Fulton] ... 2. The ZEO client storage doesn't work optimally if there isn't a main loop. In particular, without an asyncore main loop, a ZEO client storage won't see messages from the ZEO server until the client storage tries to read or write some data from or to

RE: [ZODB-Dev] OID length

2005-12-09 Thread Tim Peters
[Shane] It can do this because it has to provide its own DB and Connection objects anyway. [Tim] I trust that's for more reasons than _just_ because it doesn't want to use '\0'*8 as the root-object oid. [Shane] It's for uniformity. In Ape, the strategy for choosing OIDs is pluggable, and

RE: [ZODB-Dev] ZEO ClientStorage's use of the asyncore main loop(was [Fwd: Re: [Zope3-dev] Twisted Publisher and Zope 2])

2005-12-09 Thread Tim Peters
[Jim] Historical note: asyncore didn't support private event loops either until I added the extra argument to the constructor. I'm not sure why you need to pass the map to anything but the constructor. Oddly. most, but not all of the methods that take a map, default to the one set in the