Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-23 Thread Chris Withers
Toby Dickenson wrote: Apart from the most trivial cases, it would allow _v_ attributes to disappear at random. Its a similar problem to the one that makes it hard to write an optimiser for python code, and I am unconvinced that this is sane. Which, unfortunately, then leaves us with the problem

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-23 Thread Toby Dickenson
On Thursday 23 October 2003 08:07, Chris Withers wrote: Toby Dickenson wrote: Apart from the most trivial cases, it would allow _v_ attributes to disappear at random. Its a similar problem to the one that makes it hard to write an optimiser for python code, and I am unconvinced that this is

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-21 Thread Florent Guillaume
ChrisW wrote: Seb Bacon wrote: Agreed. Are there any situations, apart from the already discussed CMF skindata, where this currently isn't the case? I'm a bit puzzled - of what use is a variable which may disappear at any random time? For caching things... Note that caching things

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-21 Thread Florent Guillaume
IMO YAGNI. I think the application should tolerate the disappearance of _v_ vars. I would consider the problem with CMF skins a bug that needs to be fixed. AFAIK there is nothing stored in _v_skindata that cannot be reconstructed from data in the skins tool. Has an issue been filed in

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-19 Thread Dieter Maurer
Casey Duncan wrote at 2003-10-15 09:53 -0400: ... It seems to me that DAs are a bit broken with regard to where they store their database connection objects. They should register an object with the transaction that holds the connection so that it can be properly committed or aborted

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-19 Thread Dieter Maurer
Chris Withers wrote at 2003-10-15 12:49 +0100: Dieter Maurer wrote: Chris Withers wrote at 2003-10-8 21:22 +0100: Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Chris Withers
Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at transaction boundaries. Agreed. Are there any situations, apart from the already

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Chris Withers
Dieter Maurer wrote: Chris Withers wrote at 2003-10-8 21:22 +0100: Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at

Re: [Zope-CMF] Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Chris Withers
Toby Dickenson wrote: Today we have the 'transaction participant' interface. That would be a better place to hold these things, allowing the DA object itself to be deactivated if necessary. What's the 'transaction participant interface' and where can I find otu mroe about it? Chris

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Toby Dickenson
On Wednesday 15 October 2003 12:47, Chris Withers wrote: Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at transaction

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Seb Bacon
Chris Withers wrote: Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at transaction boundaries. Agreed. Are there any situations,

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Chris Withers
Seb Bacon wrote: Agreed. Are there any situations, apart from the already discussed CMF skindata, where this currently isn't the case? I'm a bit puzzled - of what use is a variable which may disappear at any random time? For caching things... Chris

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Casey Duncan
Seb Bacon wrote: Chris Withers wrote: Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at transaction boundaries. Agreed. Are

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Toby Dickenson
On Wednesday 15 October 2003 14:53, Casey Duncan wrote: Agreed. Are there any situations, apart from the already discussed CMF skindata, where this currently isn't the case? I'm a bit puzzled - of what use is a variable which may disappear at any random time? It's not exactly random.

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Casey Duncan
Toby Dickenson wrote: On Wednesday 15 October 2003 14:53, Casey Duncan wrote: Agreed. Are there any situations, apart from the already discussed CMF skindata, where this currently isn't the case? I'm a bit puzzled - of what use is a variable which may disappear at any random time?

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-15 Thread Toby Dickenson
On Wednesday 15 October 2003 15:51, Casey Duncan wrote: As it is, the hard cache implementation, although beneficial from a memory management perspective cause loaded servers to do alot more work because they are constantly pruning the cache and then reloading objects again immediately

Re: [Zope-CMF] Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-12 Thread Toby Dickenson
On Friday 10 October 2003 18:34, Dieter Maurer wrote: Toby Dickenson wrote at 2003-10-10 07:54 +0100: ... A while ago there was a discussion on zodb-dev about _v_-like attributes that would be automatically cleared at the end of a transaction. Do we need something similar that

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-10 Thread Toby Dickenson
On Thursday 09 October 2003 14:01, Florent Guillaume wrote: I agree with this. How do we go about find code that uses the assumption that _v_ stuff won't change unless it's at a transaction boundary? Note that we had a problem related to this with a client recently: In CMF, skin data is

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-10 Thread Casey Duncan
Toby Dickenson wrote: On Thursday 09 October 2003 14:01, Florent Guillaume wrote: I agree with this. How do we go about find code that uses the assumption that _v_ stuff won't change unless it's at a transaction boundary? Note that we had a problem related to this with a client recently: In CMF,

Re: [Zope-CMF] Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-10 Thread Dieter Maurer
Casey Duncan wrote at 2003-10-10 09:26 -0400: ... IMO YAGNI. I think the application should tolerate the disappearance of _v_ vars. I would consider the problem with CMF skins a bug that needs to be fixed. AFAIK there is nothing stored in _v_skindata that cannot be reconstructed from

Re: [Zope-CMF] Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-10 Thread Leonardo Rochael Almeida
On Fri, 2003-10-10 at 14:34, Dieter Maurer wrote: If such a _v_ attribute is flushed, the next access to the DA (in the same request) reopens the database. As this is a new connection, it does not see the changes made by the previous connection (in the same request). This can lead to very

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-09 Thread Florent Guillaume
I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at transaction boundaries. I agree with this. How do we go about find code that uses the

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-09 Thread Dieter Maurer
Chris Withers wrote at 2003-10-8 21:22 +0100: Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at transaction boundaries.

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-10-08 Thread Chris Withers
Casey Duncan wrote: I would argue that a better plan would be to only use _v_ vars for completely disposable data only. The application should expect that this values will be gone at any random time, not just at transaction boundaries. I agree with this. How do we go about find code that uses

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-09-29 Thread Casey Duncan
On Friday 26 September 2003 04:37 am, Toby Dickenson wrote: On Friday 26 September 2003 09:32, Chris Withers wrote: Toby Dickenson wrote: On Thursday 25 September 2003 11:51, Chris Withers wrote: Hmmm, does _p_deactivate() clear the contents of the object's _v_ variables? Yes

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-09-26 Thread Chris Withers
Toby Dickenson wrote: On Thursday 25 September 2003 11:51, Chris Withers wrote: Hmmm, does _p_deactivate() clear the contents of the object's _v_ variables? Yes Then given your earlier comment that _v_ variables are supposed to last at least teh length of the request, John's idea of using

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-09-26 Thread Toby Dickenson
On Friday 26 September 2003 09:32, Chris Withers wrote: Toby Dickenson wrote: On Thursday 25 September 2003 11:51, Chris Withers wrote: Hmmm, does _p_deactivate() clear the contents of the object's _v_ variables? Yes Then given your earlier comment that _v_ variables are supposed to

[Zope-dev] _p_deactivate() and _v_ variables?

2003-09-25 Thread Chris Withers
def traverseTree(self): ''' Traverse the tree and do something. ''' was_ghost = self._p_changed is None for ob in self.objectValues(): traverseTree(ob) # XXX Do something with self here : self.doSomething() if was_ghost:self._p_deactivate() Hmmm, does

Re: [Zope-dev] _p_deactivate() and _v_ variables?

2003-09-25 Thread Toby Dickenson
On Thursday 25 September 2003 11:51, Chris Withers wrote: Hmmm, does _p_deactivate() clear the contents of the object's _v_ variables? Yes -- Toby Dickenson ___ Zope-Dev maillist - [EMAIL PROTECTED]