/temp_folder for ZEO session
Hi, I'm struggling with seting up ZEO environment. For now I set up a Zope 2.7b2 working as ZEO client with ZEO server. In zope.conf I have two zobd_db. One for mount point "/" and ZEO client and the second one for mount point "/ temp_folder" as TemporaryFolder. With Zope everything works fine. In database management i have two bases and in zeo logs connections are logged. Now I try to set up another connection to the same ZEO server from clean python... and get stuck with OFS/Application.py trying to set object 'session_data' after executing Zope.startup(). If I understand correctly the problem lies in a Data.fs. Zope modifies Data.fs and remove /temp_folder becouse it is using the second database for it (TemporaryFolder). For a test I create another ZEO server with no database file. ZEO create the database with temp_folder in it and the problem do not appear (connection from python was succesfull). After that I attached the Zope (as ZEO client) to this ZEO server and the problem show up again. I use quite typical config for ZEO: <custom_zodb.py> import ZServer import ZEO.ClientStorage Storage=ZEO.ClientStorage.ClientStorage(('localhost',7770),storage='main') and bind from python to ZODB (through ZEO) using: Zope.startup() app=Zope.app() So my question is: How can I create from python a TemporaryStorage for ZEO client and specify it's mount point as /temp_folder? I've searched the net and newsgroups (and Zope code) but there is no clear solution for me. I would like to mimic the behaviour of ZConfig for zope.conf and it's zodb tags. I suppose that the answer is in Zope code but unfortunetly its quite comlicated and after few hours of going through it I think that's it is time to call for help ;). Thank's in advance -- Adam Szpakowski Silesian University of Technology - Institute of Physics Department of Optoelectronic e-mail: worf@optics.polsl.gliwice.pl
On Tue, 2003-10-21 at 19:06, Adam Szpakowski wrote:
Hi,
I'm struggling with seting up ZEO environment. For now I set up a Zope 2.7b2 working as ZEO client with ZEO server. In zope.conf I have two zobd_db. One for mount point "/" and ZEO client and the second one for mount point "/ temp_folder" as TemporaryFolder. With Zope everything works fine. In database management i have two bases and in zeo logs connections are logged.
Now I try to set up another connection to the same ZEO server from clean python... and get stuck with OFS/Application.py trying to set object 'session_data' after executing Zope.startup().
When you said "clean python", I wasn't expecting to see any mention of "OFS.Application". ;-)
If I understand correctly the problem lies in a Data.fs. Zope modifies Data.fs and remove /temp_folder becouse it is using the second database for it (TemporaryFolder).
That's right...
For a test I create another ZEO server with no database file. ZEO create the database with temp_folder in it and the problem do not appear (connection from python was succesfull). After that I attached the Zope (as ZEO client) to this ZEO server and the problem show up again.
I use quite typical config for ZEO:
<custom_zodb.py> import ZServer import ZEO.ClientStorage Storage=ZEO.ClientStorage.ClientStorage(('localhost',7770),storage='main')
and bind from python to ZODB (through ZEO) using: Zope.startup() app=Zope.app()
OK, first of all, you don't need to use custom_zodb.py in Zope 2.7.0b2+. Use zope.conf and then use the following to enact the options in the config file. def setup(configfile_name): from Zope.Startup.options import ZopeOptions from Zope.Startup import handlers as h from App import config opts=ZopeOptions() opts.configfile=configfile_name opts.realize() h.handleConfig(opts.configroot,opts.confighandlers) config.setConfiguration(opts.configroot) from Zope.Startup import dropPrivileges dropPrivileges(opts.configroot) Call this from your Python startup procedure.
So my question is: How can I create from python a TemporaryStorage for ZEO client and specify it's mount point as /temp_folder?
Just edit the zope.conf and specify the right stuff...
I've searched the net and newsgroups (and Zope code) but there is no clear solution for me. I would like to mimic the behaviour of ZConfig for zope.conf and it's zodb tags. I suppose that the answer is in Zope code but unfortunetly its quite comlicated and after few hours of going through it I think that's it is time to call for help ;).
Thank's in advance
HTH, - C
Chris McDonough wrote:
When you said "clean python", I wasn't expecting to see any mention of "OFS.Application". ;-)
Yes... clean in the other mean ;) I supposed that "python shell" would be better choice of words.
Call this from your Python startup procedure.
That works great. Thanks a lot. Adam -- Adam Szpakowski Silesian University of Technology - Institute of Physics Department of Optoelectronic e-mail: worf@optics.polsl.gliwice.pl
participants (2)
-
Adam Szpakowski -
Chris McDonough