Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Adam GROSZER
Hello Jim, Monday, May 10, 2010, 1:27:00 PM, you wrote: JF> On Sun, May 9, 2010 at 4:59 PM, Roel Bruggink wrote: >> That's really interesting! Did you notice any issues performance wise, or >> didn't you check that yet? JF> I didn't check performance. I just iterated over a file storage file, J

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Jim Fulton
On Tue, May 11, 2010 at 3:16 AM, Adam GROSZER wrote: > Hello Jim, > > Monday, May 10, 2010, 1:27:00 PM, you wrote: > > JF> On Sun, May 9, 2010 at 4:59 PM, Roel Bruggink wrote: >>> That's really interesting! Did you notice any issues performance wise, or >>> didn't you check that yet? > > JF> I di

Re: [ZODB-Dev] ZODB Ever-Increasing Memory Usage (even with cache-size-bytes)

2010-05-11 Thread Jim Fulton
On Mon, May 10, 2010 at 8:20 PM, Ryan Noon wrote: > P.S. About the data structures: > wordset is a freshly unpickled python set from my old sqlite oodb thingy. > The new docsets I'm keeping are 'L' arrays from the stdlib array module. >  I'm up for using ZODB's builtin persistent data structures i

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Adam GROSZER
Hello Jim, Tuesday, May 11, 2010, 12:33:04 PM, you wrote: JF> On Tue, May 11, 2010 at 3:16 AM, Adam GROSZER wrote: >> Hello Jim, >> >> Monday, May 10, 2010, 1:27:00 PM, you wrote: >> >> JF> On Sun, May 9, 2010 at 4:59 PM, Roel Bruggink wrote: That's really interesting! Did you notice any i

[ZODB-Dev] Automating retry management

2010-05-11 Thread Jim Fulton
So I'm about to update the transaction package and this gives me an opportunity to do something I've been meaning to do for a while, which is to add support for the Python with statement: with transaction: ... transaction body ... and: with some_transaction_manager as t:

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Jim Fulton
On Tue, May 11, 2010 at 7:13 AM, Adam GROSZER wrote: > Hello Jim, > > Tuesday, May 11, 2010, 12:33:04 PM, you wrote: > > JF> On Tue, May 11, 2010 at 3:16 AM, Adam GROSZER wrote: >>> Hello Jim, >>> >>> Monday, May 10, 2010, 1:27:00 PM, you wrote: >>> >>> JF> On Sun, May 9, 2010 at 4:59 PM, Roel Br

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Adam GROSZER
Hello Jim, Tuesday, May 11, 2010, 1:37:19 PM, you wrote: JF> On Tue, May 11, 2010 at 7:13 AM, Adam GROSZER wrote: >> Hello Jim, >> >> Tuesday, May 11, 2010, 12:33:04 PM, you wrote: >> >> JF> On Tue, May 11, 2010 at 3:16 AM, Adam GROSZER wrote: Hello Jim, Monday, May 10, 2010, 1:2

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Nitro
I'm already using custom transaction/savepoint context managers in my code. I use them like with TransactionContext(): db.root['sp_test'] = 'init' with SavepointContext(): db.root['sp_test'] = 'saved' On of the context managers: class TransactionContext(object): def __init__(s

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Nitro
Am 11.05.2010, 13:47 Uhr, schrieb Adam GROSZER : > Hello Jim, > > Tuesday, May 11, 2010, 1:37:19 PM, you wrote: > > JF> On Tue, May 11, 2010 at 7:13 AM, Adam GROSZER > wrote: >>> Hello Jim, >>> >>> Tuesday, May 11, 2010, 12:33:04 PM, you wrote: >>> >>> JF> On Tue, May 11, 2010 at 3:16 AM, Adam

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Nitro
> def __exit__(self, t, v, tb): > if t is not None: > self.txn.abort() > else: > for i in range(self.retryCount): Oops, bug here. It should read range(1 + self.retryCount). It should probably have unittests anyway :-) -Matthias __

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Benji York
On Tue, May 11, 2010 at 7:34 AM, Jim Fulton wrote: > [...] The best I've been > able to come up with is something like: > >    t = ZODB.transaction(3) >    while t.trying: >        with t: >            ... transaction body ... I think you could get this to work: for transaction in ZODB.retries(3

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Adam GROSZER
Hello, Tuesday, May 11, 2010, 1:59:17 PM, you wrote: N> Am 11.05.2010, 13:47 Uhr, schrieb Adam GROSZER : >> Hello Jim, >> >> Tuesday, May 11, 2010, 1:37:19 PM, you wrote: >> >> JF> On Tue, May 11, 2010 at 7:13 AM, Adam GROSZER >> wrote: Hello Jim, Tuesday, May 11, 2010, 12:33:0

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Lennart Regebro
On Tue, May 11, 2010 at 14:47, Adam GROSZER wrote: > Probably that crappy data would make the unpickler fail... or wait a > second... the unpickler is a **SECURITY HOLE** in python, isn't it? > That means feed it some random data... and stay tuned for the > unexpected. That a bitflip would genera

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Jim Fulton
On Tue, May 11, 2010 at 7:52 AM, Nitro wrote: > I'm already using custom transaction/savepoint context managers in my > code. I use them like ... > Now you could probably extend this to look like > > class TransactionContext(object): >     def __init__(self, txn = None, retryCount = 3): >        

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Leonardo Santagada
On May 11, 2010, at 9:53 AM, Lennart Regebro wrote: > On Tue, May 11, 2010 at 14:47, Adam GROSZER wrote: >> Probably that crappy data would make the unpickler fail... or wait a >> second... the unpickler is a **SECURITY HOLE** in python, isn't it? >> That means feed it some random data... and st

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Jim Fulton
On Tue, May 11, 2010 at 8:38 AM, Benji York wrote: > On Tue, May 11, 2010 at 7:34 AM, Jim Fulton wrote: >> [...] The best I've been >> able to come up with is something like: >> >>    t = ZODB.transaction(3) >>    while t.trying: >>        with t: >>            ... transaction body ... > > I thin

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Benji York
On Tue, May 11, 2010 at 10:08 AM, Jim Fulton wrote: > This is an improvement. It's still unsatisfying, but I don't think I'm going > to > get satisfaction. :) Given that PEP 343 explicitly mentions *not* supporting an auto retry construct, I should think not. :) -- Benji York __

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Jim Fulton
On Tue, May 11, 2010 at 7:47 AM, Adam GROSZER wrote: > Hello Jim, > > Tuesday, May 11, 2010, 1:37:19 PM, you wrote: > > JF> On Tue, May 11, 2010 at 7:13 AM, Adam GROSZER wrote: >>> Hello Jim, >>> >>> Tuesday, May 11, 2010, 12:33:04 PM, you wrote: >>> >>> JF> On Tue, May 11, 2010 at 3:16 AM, Adam

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Adam GROSZER
Hello Jim, Tuesday, May 11, 2010, 4:46:46 PM, you wrote: JF> On Tue, May 11, 2010 at 7:47 AM, Adam GROSZER wrote: >> Hello Jim, >> >> Tuesday, May 11, 2010, 1:37:19 PM, you wrote: >> >> JF> On Tue, May 11, 2010 at 7:13 AM, Adam GROSZER wrote: Hello Jim, Tuesday, May 11, 2010, 1

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Nitro
Am 11.05.2010, 16:01 Uhr, schrieb Jim Fulton : > This wouldn't work. You would need to re-execute the suite > for each retry. It's not enough to just keep committing the same > transaction. (There are other details wrong with the code above, > but they are fixable.) Python doesn't provide a way

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Nitro
Am 11.05.2010, 17:08 Uhr, schrieb Nitro : > Am 11.05.2010, 16:01 Uhr, schrieb Jim Fulton : > >> This wouldn't work. You would need to re-execute the suite >> for each retry. It's not enough to just keep committing the same >> transaction. (There are other details wrong with the code above, >> but

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Laurence Rowe
On 11 May 2010 15:08, Jim Fulton wrote: > On Tue, May 11, 2010 at 8:38 AM, Benji York wrote: >> On Tue, May 11, 2010 at 7:34 AM, Jim Fulton wrote: >>> [...] The best I've been >>> able to come up with is something like: >>> >>>    t = ZODB.transaction(3) >>>    while t.trying: >>>        with t:

Re: [ZODB-Dev] Automating retry management

2010-05-11 Thread Jim Fulton
On Tue, May 11, 2010 at 11:35 AM, Laurence Rowe wrote: > On 11 May 2010 15:08, Jim Fulton wrote: >> On Tue, May 11, 2010 at 8:38 AM, Benji York wrote: >>> On Tue, May 11, 2010 at 7:34 AM, Jim Fulton wrote: [...] The best I've been able to come up with is something like:    t

Re: [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-11 Thread Chris Withers
Jim Fulton wrote: >>> I plan to implement A soon if there are no objections. >>> >>> Unless someone somehow convinced me to do D, I'll also add an >>> assertion in the Transaction.join method to raise an error if a >>> data manager joins more than once. >> Option A sounds sensible. It also means I

Re: [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-11 Thread Wichert Akkerman
On 5/11/10 19:41 , Chris Withers wrote: > Jim Fulton wrote: I plan to implement A soon if there are no objections. Unless someone somehow convinced me to do D, I'll also add an assertion in the Transaction.join method to raise an error if a data manager joins more than once

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adam GROSZER wrote: > Hello Jim, > > > > Tuesday, May 11, 2010, 4:46:46 PM, you wrote: > > JF> On Tue, May 11, 2010 at 7:47 AM, Adam GROSZER wrote: >>> Hello Jim, >>> >>> Tuesday, May 11, 2010, 1:37:19 PM, you wrote: >>> >>> JF> On Tue, May 11, 20

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Jim Fulton
On Sun, May 9, 2010 at 4:59 PM, Roel Bruggink wrote: > On Sun, May 9, 2010 at 8:33 PM, Jim Fulton wrote: >> >> Our recent discussion of compression made me curious so I did some >> analysis of pickle sizes in one of our large databases. This is for a >> content management system.  The database is

Re: [ZODB-Dev] ZODB Ever-Increasing Memory Usage (even with cache-size-bytes)

2010-05-11 Thread Ryan Noon
Hi Jim, I'm really sorry for the miscommunication, I thought I made that clear in my last email: "I'm wrapping ZODB in a 'ZMap' class that just forwards all the dictionary methods to the ZODB root and allows easy interchangeability with my old sqlite OODB abstraction." wordid_to_docset is a "ZMa

Re: [ZODB-Dev] ZODB Ever-Increasing Memory Usage (even with cache-size-bytes)

2010-05-11 Thread Laurence Rowe
I think this means that you are storing all of your data in a single persistent object, the database root PersistentMapping. You need to break up your data into persistent objects (instances of objects that inherit from persistent.Persistent) for the ZODB to have a chance of performing memory mappi

Re: [ZODB-Dev] ZODB Ever-Increasing Memory Usage (even with cache-size-bytes)

2010-05-11 Thread Ryan Noon
Thanks Laurence, this looks really helpful. The simplicity of ZODB's concept and the joy of using it apparently hides some of the complexity necessary to use it efficiently. I'll check this out when I circle back to data stuff tomorrow. Have a great morning/day/evening! -Ryan On Tue, May 11, 20

Re: [ZODB-Dev] Some interesting (to some:) numbers

2010-05-11 Thread Adam GROSZER
Hello Jim, Tuesday, May 11, 2010, 8:36:46 PM, you wrote: JF> On Sun, May 9, 2010 at 4:59 PM, Roel Bruggink wrote: >> On Sun, May 9, 2010 at 8:33 PM, Jim Fulton wrote: >>> >>> Our recent discussion of compression made me curious so I did some >>> analysis of pickle sizes in one of our large data