I'm running HPUX 10.20 and Oracle 8.0.3. My goal is to use ZOracleDA, but first I must get DCOracle working. DCOracle compiles OK and I am able to connect to the database when executing from the command line. My test script is attached for reference. My problem occurs when running in the Zope environment, as ZOracleDA Product or an External Method, DCOracle hangs in the oci_8.Logon() method. I have to kill the python process to recover from the error. Yes, I have ORACLE_HOME and LD_LIBRARY_PATH set. I wrote a new module, just to login to Oracle, using code that I am more familiar with. Again with the same result, it works OK on the command line but not in Zope. I have included that code also, because it shows where the hangup is. In my module it hangs in OCIServerAttach. Here's where I need help. In both cases, its actually hanging in an Oracle function (OCILogon in oci_8.c and OCIServerAttach in my module). What might cause this? Why does it happen in the Zope environment and not in the command line environment? How do I get this working? Thanks in advance, Mark Postal postalm@nosc.mil =========================================================================== # DCOracle test script from string import join, split # If threads are enabled, then put Oracle in thread-safe mode: try: import thread except: thread=None if thread is not None: oci_.opinit(oci_.OCI_EV_TSF) del thread if __name__ == '__main__': connection_string = "system/xxxxxx" if environ.has_key('ORACLE_HOME'): print "ORACLE_HOME: ", environ['ORACLE_HOME'] else: print "ORACLE_HOME not defined" if environ.has_key('ORACLE_SID'): print "ORACLE_SID: ", environ['ORACLE_SID'] else: print "ORACLE_HOME not defined" if environ.has_key('TWO_TASK'): print "TWO_TASK: ", environ['TWO_TASK'] else: print "TWO_TASK not defined" if oci_: print "Got oci_" if oci_8: print "Got oci_8" up, s = (split(connection_string, '@')+[''])[:2] u, p = (split(up, '/')+[''])[:2] print "Logon: %s %s %s" % (u,p,s) sc=oci_8.Logon(u,p,s) _d=sc.lda() print "Logging off" oci_.ologof(_d) =============================================================== static PyObject * Logon(PyObject *ignored, PyObject *args) { char *u, *p, *d; int lu, lp, ld; if (!PyArg_ParseTuple(args, "s#s#s#", &u, &lu, &p, &lp, &d, &ld)) return NULL; Py_BEGIN_ALLOW_THREADS OCIInitialize(OCI_DEFAULT, NULL, NULL, NULL, NULL); OCIEnvInit(&envp, OCI_DEFAULT, NULL, NULL); OCIHandleAlloc(envp, (dvoid**)&hp, OCI_HTYPE_SVCCTX, NULL, NULL); OCIHandleAlloc(envp, (dvoid**)&ep, OCI_HTYPE_ERROR, NULL, NULL); OCIHandleAlloc(envp, (dvoid**)&svrp, OCI_HTYPE_SERVER, NULL, NULL); OCIHandleAlloc(envp, (dvoid**)&sesp, OCI_HTYPE_SESSION, NULL, NULL); OCIAttrSet(sesp, OCI_HTYPE_SESSION, u, lu, OCI_ATTR_USERNAME, ep); OCIAttrSet(sesp, OCI_HTYPE_SESSION, p, lp, OCI_ATTR_PASSWORD, ep); /* fails here */ printf("Attempting to attach to server\n"); OCIServerAttach(svrp, ep, (text *) 0, 0, OCI_DEFAULT); printf("Attached to server\n"); OCIAttrSet(hp, OCI_HTYPE_SVCCTX, svrp, 0, OCI_ATTR_SERVER, ep); OCISessionBegin(hp, ep, sesp, OCI_CRED_RDBMS, OCI_DEFAULT); OCIAttrSet(hp, OCI_HTYPE_SVCCTX, sesp, 0, OCI_ATTR_SESSION, ep); Py_END_ALLOW_THREADS return Py_None; }
Mark Postal wrote:
I'm running HPUX 10.20 and Oracle 8.0.3. My goal is to use ZOracleDA, but first I must get DCOracle working. DCOracle compiles OK and I am able to connect to the database when executing from the command line. My test script is attached for reference.
My problem occurs when running in the Zope environment, as ZOracleDA Product or an External Method, DCOracle hangs in the oci_8.Logon() method. I have to kill the python process to recover from the error.
Yes, I have ORACLE_HOME and LD_LIBRARY_PATH set.
I wrote a new module, just to login to Oracle, using code that I am more familiar with. Again with the same result, it works OK on the command line but not in Zope. I have included that code also, because it shows where the hangup is. In my module it hangs in OCIServerAttach.
Here's where I need help. In both cases, its actually hanging in an Oracle function (OCILogon in oci_8.c and OCIServerAttach in my module).
What might cause this?
Why does it happen in the Zope environment and not in the command line environment?
How do I get this working?
Thanks in advance, Mark Postal postalm@nosc.mil
Can I ask what version of DCOracle you are attempting to build? Some of that code looks like my recent changes with a lot of extra stuff ripped out; and may be indicative that it needs to be regressed on your platform at Oracle 8.0.3 *if* that's where it came from. However, if that's not the case, maybe a recent checkout of the DCOracle CVS will help; I have made no announcement because the ONLY platform I've tested on is Linux with Oracle 8.0.5 and 8.1.5; Oracle is variant enough that this doesn't represent a full validation. If you can't get DCOracle out of CVS, I'll send a tarball separately.
On Thu, 18 May 2000, Matthew T. Kromer wrote:
However, if that's not the case, maybe a recent checkout of the DCOracle CVS will help; I have made no announcement because the ONLY platform I've tested on is Linux with Oracle 8.0.5 and 8.1.5; Oracle is variant enough that this doesn't represent a full validation.
If you can't get DCOracle out of CVS, I'll send a tarball separately.
Ah, so maybe *you* are the person to whom I should have addressed my recent note that I sent to 'support@digicool.com'. Are you aware of the issue a few of us have run into with DCOracle munging float values into ints? Is this fixed in the CVS by any chance? In any case, how do I access the CVS version; I couldn't find it in the CVS web interface linked off of zope.com (I haven't tried to set up the non-web interface yet). --RDM
"R. David Murray" wrote:
On Thu, 18 May 2000, Matthew T. Kromer wrote:
However, if that's not the case, maybe a recent checkout of the DCOracle CVS will help; I have made no announcement because the ONLY platform I've tested on is Linux with Oracle 8.0.5 and 8.1.5; Oracle is variant enough that this doesn't represent a full validation.
If you can't get DCOracle out of CVS, I'll send a tarball separately.
Ah, so maybe *you* are the person to whom I should have addressed my recent note that I sent to 'support@digicool.com'. Are you aware of the issue a few of us have run into with DCOracle munging float values into ints? Is this fixed in the CVS by any chance? In any case, how do I access the CVS version; I couldn't find it in the CVS web interface linked off of zope.com (I haven't tried to set up the non-web interface yet).
Yes, this is in the CVS version; Chris Petrilli will probably make an announcment & a release soon. The behavior is such that NUMBER with neither scale nor precision is a float.
On Thu, 18 May 2000, Matthew T. Kromer wrote:
Yes, this is in the CVS version; Chris Petrilli will probably make an announcment & a release soon. The behavior is such that NUMBER with neither scale nor precision is a float.
Great! Thanks for the info. From your last sentence I'm wondering if the fix is a simple change to the if test in _description in ociCurs.py...maybe I'll experiment, not knowing how soon 'soon' is <grin>. --RDM
"R. David Murray" wrote:
On Thu, 18 May 2000, Matthew T. Kromer wrote:
Yes, this is in the CVS version; Chris Petrilli will probably make an announcment & a release soon. The behavior is such that NUMBER with neither scale nor precision is a float.
Great! Thanks for the info. From your last sentence I'm wondering if the fix is a simple change to the if test in _description in ociCurs.py...maybe I'll experiment, not knowing how soon 'soon' is <grin>.
In this case, yes, that's all that it is (well, it was a 1-liner in ociCurs.py).
participants (3)
-
Mark Postal -
Matthew T. Kromer -
R. David Murray