Re: [cx-oracle-users] Unable to acquire Oracle environment handle
Brought to you by:
atuining
From: Marco De P. <dep...@gm...> - 2011-02-21 13:52:52
|
I am sorry to be so stressfull but things are becoming really really strange On the base of the last mails, I was thinking it was an environment variables problem, so I started to print all the environment just before cx_Oracle.connect. The values were always good but the connection sometimes worked and sometimes not (as I already said) So i decided to modify Environment.c to inject an explicit setenv statement just before OCIEnvNlsCreate call. The result was the same: the connection sometimes worked and sometimes not. At a certain point I inserted an explicit printf statement in file Connection.c. The printf statement is located just before the Environment_NewFromScratch call The result is that everything works ... the problem is that OCIEnvNlsCreate is completelly black-box for me, I can't debug it in any way: is there any other check I can do? thanks for your patience, Marco On Thu, Feb 17, 2011 at 5:49 PM, Marco De Paoli <dep...@gm...> wrote: > On Wed, Feb 16, 2011 at 7:57 PM, Mark Harrison <mh...@pi...> wrote: >> >>> On 2/16/11 8:54 AM, Marco De Paoli wrote: >>> > everything works if I force the rebuild of a file named tests.pyc in a >>> django folder >>> > (via rm tests.pyc or via touch tests.pyc) >>> > >>> > if the file is already there I obtain "Unable to acquire Oracle >>> environment handle" >>> > >>> > Maybe it's an issue on the django side, but I can't undestand what >>> could be wrong... >>> > >>> > django is a pure python package and the question is: how can django >>> influence the OCIEnvNlsCreate call in Environment.c that, as far as I know, >>> doesn't get any login but just initialize a client data structure?!? >>> >>> >>> that one is weird. maybe you can do something like this: >>> >>> edit one or more of the django files, and put in >>> >>> conn=cx_Oracle.connect(...) >>> >>> calls. >>> >>> hopefully, the one at the very top of the first django file will be >>> successful. >>> eventually you will hit one that fails. then you can move the connect >>> lines >>> around to narrow down where the bad thing is happening. >>> >> > I injected conn=cx_Oracle.connect(...) all around django sources > > sometimes it works, other times it doesn't: I save a django file and > everything works fine, I try to lunch again and it doesn't work anymore > then I remove a pyc file and it works again, I lunch again and it works, > the third time it doesn't work anymore > > I'm sorry I cant' give you more precise infos... but I feel like I'm > chasing ghosts :( > > Marco > |