Re: [Zope] a binary of zope for debian

2005-12-20 Thread Andreas Jung



--On 21. Dezember 2005 08:41:51 +0100 adeline nombre 
<[EMAIL PROTECTED]> wrote:



  Hi.
  it's me again. I'm in trouble.


Get the sources.

-aj

pgpORV6uTIrGH.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] More on understanding conflicts

2005-12-20 Thread Dennis Allison

One more thought ---

On Wed, 21 Dec 2005, Chris McDonough wrote:

> > The structure of the method is simple enough: there is a large  
> > 
> > block which populates local variables with data from the session
> > variables
> >
> >  >  ...
> >>
> > 
> > with the body of the  containing 300 lines or so of dtml,
> > control code, sql queries, and occasional dtml-let blocks to hold
> > query results and computed values.
> 
> If this is the same getSessionVariable as you reported before (a  
> Python Script), note that each call that you make to it has  
> overhead.  It might be better to create a single Python script to  
> return all of the values that you need from the session rather than  
> calling this over and over again.  If that doesn't work, it might be  
> even better to just do SESSION.get('foobar') instead of calling a  
> Python Script for every value.
 ...
> Write conflicts happen for a transaction.  In Zope, there is one  
> transaction per request.  

There are two distinct sections to the navigation_box transaction.  One
where the session variables are read and a second where they are used. To
minimize conflicts, the what is now a single tranaction should be split 
into two separate transactions.

Any thought as to how to do that?  If navigation_box were broken into 
two separate methods, say nav_box1 and nav_box2, how does nav_box1 
commit itself and then transfer control and data (a session variable 
snapshot) to nav_box2 as a new transaction? 

I would guess that if nav_box1 redirects to nav_box2 a new transaction 
is initiated and the old one committed.  Is that correct?  And is there 
a better way to get the same effect?



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] a binary of zope for debian

2005-12-20 Thread adeline nombre
  Hi.  it's me again. I'm in trouble.  Can somebody tell me where to fin a binary of zope for debian which can be run with python2.3. ?  thank you very much
		 Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez la version beta.___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] More on understanding conflicts

2005-12-20 Thread Dennis Allison

Chris, thanks again.   You've clarified several issues. Interlinear 
comments below, original text edited with a heavy hand for brevity...

On Wed, 21 Dec 2005, Chris McDonough wrote:

> 
> If this is the same getSessionVariable as you reported before (a  
> Python Script), note that each call that you make to it has  
> overhead.  It might be better to create a single Python script to  
> return all of the values that you need from the session rather than  
> calling this over and over again.  If that doesn't work, it might be  
> even better to just do SESSION.get('foobar') instead of calling a  
> Python Script for every value.

Good point. No overhead is probably the right thing especially since 
there are no subtransactions.
> 
> 
> > I still don't have an intuitve understanding of the conflict  
> > mechanism in
> > practice.  For example, Why is the conflict error reported for the
> > navigation dtml method rather than for the getSessionVariable python
> > script which actually references the SESSION object where the conflict
> > occurs?
> 
> Write conflicts happen for a transaction.  In Zope, there is one  
> transaction per request.  So it reports the URL of the method that  
> was called as the thing that caused the conflict (because, basically,  
> it was).  A conflict is not "noticed" until a transaction is  
> committed; ZODB has no idea what caused the data structure to change  
> in a conflicting way within "application code".

Ah so desu.  That's the conceptual hook I was missing.  Only one
transaction per request and no subtransactions!  A transaction is
processing initiated by a client request or a redirect. (Anything else?)  
A transaction has its own REQUEST and RESPONSE objects.

> > A conflict error gets raised whenever another thread references the
> > same session's SESSION object.
> 
> Are you using frames by any chance?  It would be understandable that  
> you're seeing an increased number conflicts if you have an  
> application in which many threads try to access the same session  
> object at once due to a browser making multiple writes to the same  
> session object because of frames.

Yes, we do use frames.  We manage rendering explicitly with a bit of 
Javascript magic so the full frameset rarely gets rerendered.  But, it 
certainly could be a contributing factor.

> 
> >   Apparently the MVCC read-read conflict
> > resolution fails for session variables although I am not sure why.
> 
> Can we see one of the conflict tracebacks?  You should be seeing only  
> write conflicts.  Read conflict errors are reported in a traceback  
> with a ReadConflictError message (conflicts reported as only  
> ConflictError are write conflicts).
> 

I'll try to find a few tracebacks.

-- 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] More on understanding conflicts

2005-12-20 Thread Chris McDonough
The structure of the method is simple enough: there is a large  


block which populates local variables with data from the session
variables





with the body of the  containing 300 lines or so of dtml,
control code, sql queries, and occasional dtml-let blocks to hold
query results and computed values.


If this is the same getSessionVariable as you reported before (a  
Python Script), note that each call that you make to it has  
overhead.  It might be better to create a single Python script to  
return all of the values that you need from the session rather than  
calling this over and over again.  If that doesn't work, it might be  
even better to just do SESSION.get('foobar') instead of calling a  
Python Script for every value.


So, this navigation method is clearly a good candidate for  
refactoring,

but the question is "What's the best way to refactor it?".


Making it do its job faster will likely help.  Likewise,

I still don't have an intuitve understanding of the conflict  
mechanism in

practice.  For example, Why is the conflict error reported for the
navigation dtml method rather than for the getSessionVariable python
script which actually references the SESSION object where the conflict
occurs?


Write conflicts happen for a transaction.  In Zope, there is one  
transaction per request.  So it reports the URL of the method that  
was called as the thing that caused the conflict (because, basically,  
it was).  A conflict is not "noticed" until a transaction is  
committed; ZODB has no idea what caused the data structure to change  
in a conflicting way within "application code".


A conflict error gets raised whenever another thread references the  
same

session's SESSION object.


Are you using frames by any chance?  It would be understandable that  
you're seeing an increased number conflicts if you have an  
application in which many threads try to access the same session  
object at once due to a browser making multiple writes to the same  
session object because of frames.



  Apparently the MVCC read-read conflict
resolution fails for session variables although I am not sure why.


Can we see one of the conflict tracebacks?  You should be seeing only  
write conflicts.  Read conflict errors are reported in a traceback  
with a ReadConflictError message (conflicts reported as only  
ConflictError are write conflicts).



  The
DEBUG logs indicate that read-read conflicts found.  It would be  
helpful

to understand why.


Yes.  A traceback would help.


When the conflict is resolved, one is backed out (everything is
transactional) and restarted.  After three retries, it is considered
an error.   This processing is handled automatically by Zope.


That's right.


At one point, I had considered writing a custom conflict resolution
function where resolution assumed independence of individual session
variables.  After some thought and experimentation, I concluded  
that was a
bad idea because it could break synchronization assertions between  
session

variables (e.g., X is twice Y).


That's a good conclusion.

Absent a magical conflict resolution method, the best approach  
would seem
to be to minimize the potential for conflicts.  Intuition says that  
the
simplest way to do this would be to have the navigation dtml method  
make a
single call to a python script, getSessionVariables, which would  
return a

copy of the session variables. The copy could then be unpacked and
processed without any potential conflict errors.


Heh.  Good thinking! ;-)   Really, anything that makes your  
transaction finish faster is the right thing (and good coding  
practice to boot).  Maybe not a silver bullet especially if you're  
using frames but it's a start.


- C

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: why will FastCGI not be supported in the Future.

2005-12-20 Thread Tino Wildenhain
David Bear schrieb:
> 
> 
> On 12/10/05, *Tino Wildenhain* <[EMAIL PROTECTED]
> > wrote:
> 
> Am Mittwoch, den 07.12.2005, 09:39 + schrieb Chris Withers:
> > Dieter Maurer wrote:
> > > The original poster explained his wish to retain FCGI:
> > >
> > >   It reuses an existing connection between Apache and Zope
> > >   while (he thinks and I might believe it) the recommended
> > >   "mod_proxy" way each time opens a new connection.
> > >
> > >   Thus, FastCGI might be more efficient.
> >
> > Show me some evidence proving that fcgi or mod_proxy is the
> significant
> > limiting performance factor in a setup involving zope and I'll
> take this
> > seriously ;-)
> 
> The funny thing is - performance isnt really the pro of
> fcgi over http. Its really more about transporting header
> and environment data from zope to apache, which is
> kinda limited with mod_proxy. (Think alternative
> authentication, ssl )
> 
> 
> 
> This was my  reason for going with  fastcgi instead of modproxy. I
> wanted zope to also log the http header data from the client. I want to
> have zope make some decisions based on the user agent. If modproxy can
> preserve ALL the request headers that I suppose I can use it. I somewhat
> understand fastcgi. I don't understand everything mod-proxy does...
> (well, its more magical than fastcgi)

mod_proxy passes all relevent headers. Even user-agent.
But serious web development should never try to depend
on the useragent string. (it can and will be faked - and
you will have a hard time to know all possible user-agents
out there (I occassionally browse as google - you would
be surpriced what you see :))

The only hard part is ssl-client certificate or other
apache side auth information. Auth-headers (basic auth)
are of course passed.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] More on understanding conflicts

2005-12-20 Thread Dennis Allison
Zope 2.8.4
ZODB 3.4.2


I have a dtml method which is an obvious hotspot.  It puts up navigation
wigetry and is rendered on nearly every page.  The logs show it generates
a large number of conflicts.  The conflicts are in TemporaryStrorage and
so are due to session variables.

The session variables are accessed with short Script(Python) functions
one call per session variable used: getSessionVariable( var ),  Session 
variable hold mostly data that is constant throughout the session.  There 
are about twenty values, ten of which are referenced in the navigation 
method.

The structure of the method is simple enough: there is a large 
block which populates local variables with data from the session 
variables   



with the body of the  containing 300 lines or so of dtml, 
control code, sql queries, and occasional dtml-let blocks to hold 
query results and computed values.

So, this navigation method is clearly a good candidate for refactoring,
but the question is "What's the best way to refactor it?".

I still don't have an intuitve understanding of the conflict mechanism in
practice.  For example, Why is the conflict error reported for the
navigation dtml method rather than for the getSessionVariable python
script which actually references the SESSION object where the conflict 
occurs?
 
A conflict error gets raised whenever another thread references the same
session's SESSION object.  Apparently the MVCC read-read conflict
resolution fails for session variables although I am not sure why.  The
DEBUG logs indicate that read-read conflicts found.  It would be helpful
to understand why.

When the conflict is resolved, one is backed out (everything is 
transactional) and restarted.  After three retries, it is considered 
an error.   This processing is handled automatically by Zope.

At one point, I had considered writing a custom conflict resolution
function where resolution assumed independence of individual session
variables.  After some thought and experimentation, I concluded that was a
bad idea because it could break synchronization assertions between session
variables (e.g., X is twice Y).

Absent a magical conflict resolution method, the best approach would seem
to be to minimize the potential for conflicts.  Intuition says that the
simplest way to do this would be to have the navigation dtml method make a
single call to a python script, getSessionVariables, which would return a
copy of the session variables. The copy could then be unpacked and 
processed without any potential conflict errors.



 



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope, Apache, REMOTE_USER

2005-12-20 Thread David Bear
could this be one reason to keep fastcgi?On 12/19/05, Robert Boyd <[EMAIL PROTECTED]> wrote:
I'm using Apache 2.0, and I cannot find a solution to passing thevalue of REMOTE_USER from Apache to Zope when using a rewrite rule. I
have Apache rewriting requests for Zope, and hooked into Tomcat withmod_jk. My users login through a servlet, and Apache has REMOTE_USERavailable to it. But any subsequent request to Zope loses this value.
I used to have this all working when using FastCGI, but I'm hoping touse only mod_rewrite. Is it possible?Thanks,Rob___Zope maillist  -  
Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope**   No cross posts or HTML encoding!  **(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- David BearWhat's the difference between private knowledge and public knowledge?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: why will FastCGI not be supported in the Future.

2005-12-20 Thread David Bear
On 12/10/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
Am Mittwoch, den 07.12.2005, 09:39 + schrieb Chris Withers:> Dieter Maurer wrote:> > The original poster explained his wish to retain FCGI:> >> >   It reuses an existing connection between Apache and Zope
> >   while (he thinks and I might believe it) the recommended> >   "mod_proxy" way each time opens a new connection.> >> >   Thus, FastCGI might be more efficient.>
> Show me some evidence proving that fcgi or mod_proxy is the significant> limiting performance factor in a setup involving zope and I'll take this> seriously ;-)The funny thing is - performance isnt really the pro of
fcgi over http. Its really more about transporting headerand environment data from zope to apache, which iskinda limited with mod_proxy. (Think alternativeauthentication, ssl )

This was my  reason for going with  fastcgi instead of
modproxy. I wanted zope to also log the http header data from the
client. I want to have zope make some decisions based on the user
agent. If modproxy can preserve ALL the request headers that I suppose
I can use it. I somewhat understand fastcgi. I don't understand
everything mod-proxy does... (well, its more magical than fastcgi)
Tino.___Zope maillist  -  
Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope**   No cross posts or HTML encoding!  **(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev
 )-- David BearWhat's the difference between private knowledge and public knowledge?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] ZDaemon for wsgi server

2005-12-20 Thread David Pratt
Hi I am looking at light wsgi servers to serve an app but want it to be 
started from command line and have the thread spun off so it stays 
running (instead of tying up a terminal until a interrupt is given).


I was thinking that perhaps ZDaemon could do this since perhaps I could 
also get logging as as well and I would not have to potentially write 
the threading code. If this is reasonable, can someone give me a basic 
outline for doing this. I am interested in running the wsgiserver 
locally. Many thanks. Regards,


David
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL with different user

2005-12-20 Thread J Cameron Cooper

Pier Luigi Fiorini wrote:

Alle 18:42, lunedì 19 dicembre 2005, hai scritto:


Pier Luigi Fiorini wrote:


Hello,
I'm developing a Zope application that uses a PostgreSQL connection and
several ZSQL objects.
People should log in using a Postgres user and ZSQL object should be
executed by the user that's logged in. Multiple people can be logged at
the same time. Unfortunately it is not possible because the same Postgres
connection is used by all the ZSQL object. Is there a way to change the
user executing a ZSQL query?

An alternative would be to log into the event.log some information (like
the username, that's stored in the session) and the query source.


Your alternative is dead easy. zLOG (or, better, the Python logging
module, for which zLOG is now a facade) is quite easy to use. You can
even make your own log file to contain only such events.


I know _how_ to use zLOG. I just don't know how to log the query source.
Is there some documentation about these things. I can find only documentation 
about making things like a simple form which is not so useful because you can 
learn it in some days.


That depends. What do you mean by "query source"?

--jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] APE and Zope 2.9?

2005-12-20 Thread Peter Sabaini
It seems APE 1.0 doesnt run out of the box with Zope 2.9 -- has anyone tried 
hacking APE up so it can run inside Zope 2.9? 

Any thoughts as to what would be necessary / how hard this would be?


Thanks,
peter.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] error installing zope from source

2005-12-20 Thread adeline nombre
Hi.  the problem now is that when I do "make" there is this error message:" does not find file /usr/lib/python2.3/config/Makefile . And when I look in /usr/lib/python2.3/ , there is no directory "config".  I have python2.3.  my OS is debian sarge.  Do u have an idea about what I should do?thank you very much
		 Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez la version beta.___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Final reminder: Zope Foundation IRC, Tue, Dec 20, 1p (US/EST)

2005-12-20 Thread Rob Page

Hello everyone:

Here is a final reminder of the upcoming IRC to discuss
the Zope Foundation documents.  Please join us!
Details follow:

   Who: Zope Community

   What: IRC to discuss Zope Foundation formation
 documents.

   Where:  #zope on irc.freenode.net

   When:  Tue, Dec 20, 100p - 230p (US/EST)

  US/EST is GMT-5.

--
Rob Page   V: 540 361 1710
Zope Corporation   F: 703 995 0412




___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to make good architecture in Zope2?

2005-12-20 Thread Lennart Regebro
On 12/20/05, Roman Suzi <[EMAIL PROTECTED]> wrote:
> Lets suppose that I've done OO Analysis and have a dozen of nice classes
> which model my problem domain. Lets also suppose that I did it on the
> basis of known use cases. Now I want to build Web application fulfilling
> those use cases but  separate my  classes from Zope framework (Ok,  some
> of them could be taken from Zope framework, like user folder), so that I
> can see the problem domain abstractions in the clear, without a mess of
> miriads of Presentation injections.
> (I'd liked to put presentation-related things into other classes and ZPTs)
>
> Are there any good examples out there, or any good architectural
> solutions for that?

Yes. Zope 3. ;)
Zope 3 adresses several of these questions, especially the separation
of presentation from logic on a class bases. And of you can't use Zope
3, then you can use the same principals under Zope 2 thanks to the
Five technology:
http://codespeak.net/z3/five/

Five is included with Zope 2 since Zope 2.8.

> Or is it even possible in Zope2 to go that far
> without doing to much adaptation?

No problems at all. Nuxeos new calendar product is done exactly like
that, even to the point that the base classes are in a separate
product (CalCore) that could be used outside of Zope, the UI is in
another product (CalZope) that provides all the pages, and we have
integration with CPS in a third product (a Plone integration,
CalPlone, is in progress).

> What I see in real world examples, is extensive use of mix-ins. Is it
> the only feasible way to at least textually separate Logic from
> Presentation?

Not at all, if you don't want to do it the Z3 way, you can do it with
subclassing.

> (What about delegation?)

Well, I guess that's pretty much what zope 3 does. The presentation is
done in separate classes called view-classes.

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] How to make good architecture in Zope2?

2005-12-20 Thread Roman Suzi

Hi!

This question is not about how to make a Zope2 product, but how to get 
most from separating concerns while making Web application in Zope2.


Lets suppose that I've done OO Analysis and have a dozen of nice classes 
which model my problem domain. Lets also suppose that I did it on the 
basis of known use cases. Now I want to build Web application fulfilling 
those use cases but  separate my  classes from Zope framework (Ok,  some 
of them could be taken from Zope framework, like user folder), so that I 
can see the problem domain abstractions in the clear, without a mess of 
miriads of Presentation injections.

(I'd liked to put presentation-related things into other classes and ZPTs)

Are there any good examples out there, or any good architectural 
solutions for that? Or is it even possible in Zope2 to go that far 
without doing to much adaptation?


What I see in real world examples, is extensive use of mix-ins. Is it 
the only feasible way to at least textually separate Logic from 
Presentation?
(What about delegation?) Is there any pattern which doesn't look strange 
in Zope2 while letting me do what I described above?


Thank you in advance!

Regards,
Roman Suzi

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-20 Thread Chris McDonough

Trimmed Zope-dev from this (cross-posts are bad)...


Dennis,
Lets just put the question out there:  Does:

SESSION['someKey'] = someValue

Force a commited transaction?

As opposed to ...
someDict = Session['SomeKey']
someDict['aKey'] = 'aNewValue'


Neither "forces a committed transaction", but the former directly  
marks an object (the session object) as changed.  The latter does not  
mark any object as changed if someDict is actually a Python  
dictionary and not a first-class persistent object.  At the end of a  
transaction, only objects that are marked as changed are re-persisted  
to the database.


This is further explained in the "mutable subobjects" section of the  
sessions chapter of the Zope Book on plope.com.


- C

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-20 Thread Chris McDonough


On Dec 20, 2005, at 12:36 AM, Dennis Allison wrote:



The interaction between sessions, conflicts, and persistence is a bit
confusing.  I am still trying to understand the code in depth.

One thing is for sure, request.SESSION and/or request['SESSION']  
must be
persistent for things to work.  Mutable objects in the session  
variable

set (dictionaries and lists) have to be handled specially to get the
persistence machinery to recognize they have been changed.

In this case, I am trying to ensure that the session variables get
identified as persistent.  My question is whether using update (an
implicit assignment) triggers the persistence mechanism.  It is the
moral equivalent of writing

request['SESSION']['alpha'] = 'a'B
request['SESSION']['beta'] = 'b'

but I am unsure whether the persistence mechanism will recognize it as
such.



The implementation of TransientObjects's update method is:

def update(self, d):
self._p_changed = 1
for k in d.keys():
self[k] = d[k]


So yes...

- C

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: ZSQL with different user

2005-12-20 Thread Pier Luigi Fiorini
> I would also be interested in multiuser ZSQLs, though it's not my main
> goal and I don't expect participating on such coding.
>
> Provided there wont be thousands of users (mine number is just about
> 20), how about to create a pool of connections in some ZODB folder,
> simply identified as sqlconn_jack, sqlconn_john, sqlconn_martin, ... and
> teach ZSQLMethod to select appropriate connection upon request?
>
> SQL connections currently support auto-connection upon request, so a
> timeout disconnection would be nice added feature in this case, but for
> small number of users it does not seem to be necessary.
>
> I think this would be a considerable, but easily implemented, step to
> obtain SQL userbase binding.


> Is there a problem somewhere?
Yep, I thought to do it as well but it's not so elegant (which may not be a 
problem) and you cannot maintain it when users create other users because you 
also have to create another psql connection.
-- 
YACME S.r.l.
Via del Mobiliere, 9 40138 Bologna
Tel: +39 051 538709
Fax: +39 051 532399
[EMAIL PROTECTED]
www.yacme.com


pgpY4AJk5yATW.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ERROR BeforeTraverse Error while invoking hook

2005-12-20 Thread Maciej Wisniowski
> You might have a access rule in there that expects to be able to 
call  something that's missing?
Thanks for the answer I've checked this, but the problem was different - 
I think we've

solved it already :)
We're using VirtualHostMonster and exUserFolder and I think those
have hooks for objects below in acquisition chain. If there is object with
id 'input' it causes this error. I'm not sure if it was caused by VHM
or exUserFolder (or something other), but in 'clean' Zope folder 'input'
causes no errors.
One more thing: I've checked again old logs from Zope 2.7.2 and the
problem was there too, so it's not 2.8.x issue.

--
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL with different user

2005-12-20 Thread Pier Luigi Fiorini
Alle 18:42, lunedì 19 dicembre 2005, hai scritto:
> Pier Luigi Fiorini wrote:
> > Hello,
> > I'm developing a Zope application that uses a PostgreSQL connection and
> > several ZSQL objects.
> > People should log in using a Postgres user and ZSQL object should be
> > executed by the user that's logged in. Multiple people can be logged at
> > the same time. Unfortunately it is not possible because the same Postgres
> > connection is used by all the ZSQL object. Is there a way to change the
> > user executing a ZSQL query?
> >
> > An alternative would be to log into the event.log some information (like
> > the username, that's stored in the session) and the query source.
>
> Your alternative is dead easy. zLOG (or, better, the Python logging
> module, for which zLOG is now a facade) is quite easy to use. You can
> even make your own log file to contain only such events.
I know _how_ to use zLOG. I just don't know how to log the query source.
Is there some documentation about these things. I can find only documentation 
about making things like a simple form which is not so useful because you can 
learn it in some days.
-- 
YACME S.r.l.
Via del Mobiliere, 9 40138 Bologna
Tel: +39 051 538709
Fax: +39 051 532399
[EMAIL PROTECTED]
www.yacme.com


pgp3kODOcvUzE.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )