when I was calling the function from a shell it was importing DCOracle2 from the /usr/lib/python calling it from within zope is importing DCOracle2 from $ZOPE_HOME/bin/python It appears that these two copies of DCOracle2 are different. So I solved the problem by copying DCOracle2 from the standalone python into $ZOPE_HOME/lib/python2.1/site-packages. So far it is working. I hope this will not be a problem down the road. I would be very interested to understand why these two copies behave differently?? Thanks for your response Bogdan, -Hara -----Original Message----- From: Bo M. Maryniuck [mailto:b.maryniuk@forbis.lt] Sent: Wednesday, October 02, 2002 12:50 AM To: Dilley, Hara; zope@zope.org Subject: Re: [Zope] DCOracle2 On Wednesday 02 October 2002 01:27, Dilley, Hara wrote:
I have an external method calling a function that is connecting to an Oracle database using DCOracle2. When I call this function from the shell it runs fine; connects to the database. From zope however it doesn't work. It errors out at the DCOracle2.connect(connectionstring). Any help on this or any information on how to debug this error would be greatly appreciated.
You import DCOracle2 from which Python: /usr/lib/python/ or $ZOPE_HOME/bin/python? Check anyway for: 1. Oracle environment is for Zope. 2. your database is in /oracle/network/admin/tnsnames.ora 3. Set up "Stupid log"? -- Regards, Bogdan Science is to computer science as hydrodynamics is to plumbing.
Dilley, Hara wrote:
when I was calling the function from a shell it was importing DCOracle2 from the /usr/lib/python calling it from within zope is importing DCOracle2 from $ZOPE_HOME/bin/python It appears that these two copies of DCOracle2 are different. So I solved the problem by copying DCOracle2 from the standalone python into $ZOPE_HOME/lib/python2.1/site-packages. So far it is working. I hope this will not be a problem down the road. I would be very interested to understand why these two copies behave differently??
Thanks for your response Bogdan,
-Hara
The Zope/lib/python/DCOracle2 directory is the Zope adapter; it contains the database adapter as a component. You may feel free to rename the outer directory to ZOracleDA if you wish; the name of the outer directory is not relevant to Zope.
On Wednesday 02 October 2002 18:01, Matthew T. Kromer wrote:
The Zope/lib/python/DCOracle2 directory is the Zope adapter; it contains the database adapter as a component. You may feel free to rename the outer directory to ZOracleDA if you wish; the name of the outer directory is not relevant to Zope.
To "Dilley, Hara": Yes, and *READ* the installation notes. ;-) -- Regards, Bogdan Added mysterious, undocumented --scanflags and --fuzzy options. -- nmap 3.0 announcement
On Wednesday 02 October 2002 17:53, Dilley, Hara wrote:
when I was calling the function from a shell Sorry?! What You mean "calling a function from a shell"?
it was importing DCOracle2 from the /usr/lib/python calling it from within zope is importing DCOracle2 from $ZOPE_HOME/bin/python Oh, that's *slow*. And why in this way? Or I something missunderstood?
It appears that these two copies of DCOracle2 are different. So I solved the problem by copying DCOracle2 from the standalone python into $ZOPE_HOME/lib/python2.1/site-packages. So far it is working. I hope this will not be a problem down the road. I would be very interested to understand why these two copies behave differently?? Are You new to the Zope? Well... Zope does not use interpreter from the /usr/bin/python (or /usr/local/bin/python) and all the stuff in the /usr/lib/python/* but uses it's own interpteter. So You should setup DCOracle2 for the interpter which Zope uses.
First, that you have installed in wrong way, and probably something missed here. Just run the following: cd /where/your/unpacked/DCOracle2 $zope_home/bin/python setup.py install Then (this *I* did, but You can do that in other way) just put all the Oracle environment variables into the script which starts the Zope. It might be $zope_home/start, but better some wrapper in /etc/init.d/zope or whatever. This is the common Oracle Client env. variables in case I've installed it into the root as "/oracle": ORACLE_HOME=/oracle NLS_LANG=AMERICAN_AMERICA.LT8MSWIN921 ORACLE_SID=DVLP PATH=$PATH:/oracle/bin LD_LIBRARY_PATH=/oracle/lib export ORACLE_HOME export NLS_LANG export ORACLE_SID export PATH export LD_LIBRARY_PATH
Thanks for your response Bogdan, You welcome, HTH.
P.S. Windows-depending problems I don't know and wouldn't. P.P.S. Matt might bite me for the adding Oracle env. into the Zope startscript. :D -- Regards, Bogdan Anybody who doesn't cut his speed at the sight of a police car is probably parked.
participants (3)
-
Bo M. Maryniuck -
Dilley, Hara -
Matthew T. Kromer