Re: [cx-oracle-users] Unable to acquire Oracle environment handle
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2011-02-21 18:21:21
|
That does indeed sound rather strange. OCIEnvNlsCreate() is an Oracle function so there is no way to debug this short of calling up Oracle and asking them for support. Is this a single threaded program? If it is multi-threaded you will need to set threaded mode to avoid strange problems -- perhaps ones like these. Are you opening/closing the connection multiple times in your program or just running a program over and over again and noting errors one time and not the next? I've never run into these problems myself so not sure how to help you further besides giving suggestions for debugging on your own! Anthony On Mon, Feb 21, 2011 at 6:52 AM, Marco De Paoli <dep...@gm...> wrote: > 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 > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |