[ZODB-Dev] Adopting ZODB

2006-07-13 Thread Chris S
I'm trying to adopt some code to use ZODB as its persistence level. I've read the Writing a Persistent Class article (http://www.zope.org/Wikis/ZODB/FrontPage/guide/node3.html#SECTION00035) but how do you persist a class that already inherits another class? Does ZODB work with

Re: [ZODB-Dev] Adopting ZODB

2006-07-13 Thread Chris S
On 7/13/06, David Binger [EMAIL PROTECTED] wrote: On Jul 13, 2006, at 12:55 PM, Chris S wrote: I don't think this is the case. Consider my simple example below. None of my classes inherit Persistent, and even though I set _p_changed = 1, nothing's persisted. In your example, it seems like

Re: [ZODB-Dev] Adopting ZODB

2006-07-13 Thread Chris S
On 7/13/06, David Binger [EMAIL PROTECTED] wrote: On Jul 13, 2006, at 1:35 PM, Chris S wrote: On 7/13/06, David Binger [EMAIL PROTECTED] wrote: On Jul 13, 2006, at 12:55 PM, Chris S wrote: I don't think this is the case. Consider my simple example below. None of my classes inherit

Re: [ZODB-Dev] Adopting ZODB

2006-07-13 Thread Chris S
On 7/13/06, David Binger [EMAIL PROTECTED] wrote: On Jul 13, 2006, at 3:55 PM, Chris S wrote: Uh, calling root.get(name, obj) assigns obj to the root if the name is not yet defined. And of course I'm not assigning to any other Persistent instances, since the point of the code was to show

[ZODB-Dev] Class Versioning

2006-07-14 Thread Chris S
I'm trying to detect a disparity between an instance __version__ and a class __version__, signifying a class upgrade. However, I'm not sure why the following code doesn't work. class Foo(Persistent): __version__ = 1.0 def __setstate__(self, state): Persistent.__setstate__( self,

[ZODB-Dev] Re: Class Versioning

2006-07-14 Thread Chris S
On 7/14/06, Chris S [EMAIL PROTECTED] wrote: I'm trying to detect a disparity between an instance __version__ and a class __version__, signifying a class upgrade. However, I'm not sure why the following code doesn't work. class Foo(Persistent): __version__ = 1.0 def __setstate__(self

[ZODB-Dev] Re: Dynamically Updating Objects

2006-07-18 Thread Chris S
in ZODB to first close all connections, call resetCaches(), then reopen the connections? Chris On 7/14/06, Chris S [EMAIL PROTECTED] wrote: I have a small module that can dynamically update code objects in memory after reloading their module (http://paste.plone.org/5431). It greatly simplifies

[ZODB-Dev] Threads and Connections

2006-07-21 Thread Chris S
Is it possible to close a connection used in one thread from another thread? My program has a locking mechanism, so I can ensure threads don't use their connection while it's closed, but whenever I try to close one thread's connection from another thread, I get errors like: self.conn.close()

Re: [ZODB-Dev] Threads and Connections

2006-07-26 Thread Chris S
On 7/26/06, Gary Poster [EMAIL PROTECTED] wrote: The reason why I'm doing this is because I'm trying to update the classes of persistent objects loaded into memory. Want to elaborate on this a bit? It sounds like stuff other folks have done, but you might want to give more detail. When a

Re: [ZODB-Dev] Threads and Connections

2006-07-26 Thread Chris S
On 7/26/06, Chris McDonough [EMAIL PROTECTED] wrote: FWIW I believe by default at least, open ZODB connections are tied to the thread which did the opening (they are returned to a pool when closed and reused, possibly in another thread). And indeed each connection does have a cache; caching is

[ZODB-Dev] Nearest Neighbors with OOBTree

2006-07-27 Thread Chris S
Is there a way to determine the nearest neighbors to a key in an OOBTree? Something like: from BTrees.OOBTree import OOBTree tree = OOBTree(dict(a=1, b=2, c=3, d=4)) tree.nearestLowItem('b') ('a',1) tree.nearestHighItem('b') ('c',3) ___ For more

[ZODB-Dev] Calculating Physical Object Size

2006-08-08 Thread Chris S
Is there anyway to determine how much disk space a specific object (including child objects) occupies in filestorage? For argument's sake, I'm assuming farily simplistic structures with no circular references. Chris ___ For more information about ZODB,

[ZODB-Dev] Commit Progress Indictor

2006-08-14 Thread Chris S
When commiting a transaction, is there any way to track the progress of data commited? I have a small gui app, and I'd like to display a progress bar indicating the status of the commit. Chris ___ For more information about ZODB, see the ZODB Wiki:

Re: Re[4]: [ZODB-Dev] Commit Progress Indictor

2006-08-25 Thread Chris S
On 8/16/06, Jim Fulton [EMAIL PROTECTED] wrote: On Aug 16, 2006, at 5:13 AM, Adam Groszer wrote: Hello Andreas, Yep, you're right :-) Are there any hooks in ZODB to support that or that should be a major overhaul? There are no hooks. It would probably not be a major overhaul, however,

[ZODB-Dev] Coping with Class Changes

2006-09-03 Thread Chris S
Is there a standard procedure for dealing with fundamental changes to classes? For instance, how do you make a ZODB cope with a class being renamed, or being placed in a different location? How will it know that oldmod.myclass == newmod.myclass? Chris

[ZODB-Dev] Problem Storing Infinity

2006-09-12 Thread Chris S
I'm having a problem storing infinity. The following code reproduces the problem on w2k: from ZODB import FileStorage, DB from persistent import Persistent from persistent.mapping import PersistentMapping as dict import transaction storage = FileStorage.FileStorage('zodb.db') db = DB(storage)