Re: cursor.execute() stays blocked on a weird statement without propagating ORA-01652

Anthony Tuininga <[email protected]> Mon, 3 May 2021 10:52:18 -0600
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAE1XR-4UVa8jTiUoH5a0wNXr0SO7MLs5n85U2=tu_p__V2CWnA@mail.gmail.com>
--===============1038631503664953914==
Content-Type: multipart/alternative; boundary="0000000000007cbd6e05c16fc9d3"

--0000000000007cbd6e05c16fc9d3
Content-Type: text/plain; charset="UTF-8"

Hi,

First, this e-mail list is no longer used very much. I would suggest adding
an issue here: https://github.com/oracle/python-cx_Oracle/issues. You're
more likely to get help there.

Second, you need to set DPI_DEBUG_LEVEL to the value 4, not 64. 64 is used
for logging messages while the library is being loaded and 4 is used for
logging ODPI-C calls -- which is what you want in this case. That said, you
should *still* see messages -- even if only the one saying that debugging
messages have been initialized. So double check that the environment
variable is in fact being set!

Finally, I have no idea why SQL*Plus would "work" and cx_Oracle "would not
work" since they use the same libraries. It might be helpful to show the
cx_Oracle code you are using.

Anthony

On Sat, May 1, 2021 at 11:46 PM ConcreteVitamin <[email protected]>
wrote:

>  Hi there,
>
> I've a weird statement that's pretty expensive.  Entering this SQL
> statement in sqlplus eventually leads to this error:
>
>     ERROR at line 1:
>     ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
>
> This is expected & good.
>
> However, using cx_Oracle, specifically using
>
>     cursor.execute(same_statement)
>
> would result in the same amount of work being done, and at some point the
> CPU utilization on the server stopped -- which meant ORA-01652 has happened
> -- but the cursor.execute(...) call stays blocked without raising an
> exception.  This makes the app stay in a stuck state.  At that point it
> doesn't respond to Ctrl-C SIGINT.
>
> I've tried export DPI_DEBUG_LEVEL=64 and there are no messages being
> printed.
>
> What's wrong?  Is it possible to enable an exception to be raised?
>
> Server: 19c [where sqlplus was run]
> cx_Oracle: 8.1 [different host from the server; using same DSN as sqlplus]
>
> Thanks.
> _______________________________________________
> cx-oracle-users mailing list
> cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>

--0000000000007cbd6e05c16fc9d3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>First, this e-mail list is no longe=
r used very much. I would suggest adding an issue here:=C2=A0<a href=3D"htt=
ps://github.com/oracle/python-cx_Oracle/issues">https://github.com/oracle/p=
ython-cx_Oracle/issues</a>. You&#39;re more likely to get help there.</div>=
<div><br></div><div>Second, you need to set DPI_DEBUG_LEVEL to the value 4,=
 not 64. 64 is used for logging messages while the library is being loaded =
and 4 is used for logging ODPI-C calls -- which is what you want in this ca=
se. That said, you should *still* see messages -- even if only the one sayi=
ng that debugging messages have been initialized. So double check that the =
environment variable is in fact being set!</div><div><br></div><div>Finally=
, I have no idea why SQL*Plus would &quot;work&quot; and cx_Oracle &quot;wo=
uld not work&quot; since they use the same libraries. It might be helpful t=
o show the cx_Oracle code you are using.</div><div><br></div><div>Anthony</=
div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_at=
tr">On Sat, May 1, 2021 at 11:46 PM ConcreteVitamin &lt;<a href=3D"mailto:c=
[email protected]">[email protected]</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">=C2=A0H=
i there,<div><br></div><div>I&#39;ve a weird statement that&#39;s pretty ex=
pensive.=C2=A0 Entering this SQL statement in sqlplus eventually leads to t=
his error:</div><div><br></div><div>=C2=A0 =C2=A0 ERROR at line 1:<br>=C2=
=A0 =C2=A0 ORA-01652: unable to extend temp segment by 128 in tablespace TE=
MP<br></div><div><br></div><div>This is expected &amp; good.=C2=A0=C2=A0</d=
iv><div><br></div><div>However, using cx_Oracle, specifically using=C2=A0</=
div><div><br></div><div>=C2=A0 =C2=A0 cursor.execute(same_statement)</div><=
div><br></div><div>would result in the same amount of work being done, and =
at some point the CPU utilization on the server stopped -- which meant=C2=
=A0ORA-01652 has happened -- but the cursor.execute(...) call stays blocked=
 without raising an exception.=C2=A0 This makes the app stay in a stuck sta=
te.=C2=A0 At that point it doesn&#39;t respond to Ctrl-C SIGINT.</div><div>=
<br></div><div>I&#39;ve tried export=C2=A0DPI_DEBUG_LEVEL=3D64 and there ar=
e no messages being printed.</div><div><br></div><div>What&#39;s wrong?=C2=
=A0 Is it possible to enable an exception to be raised?=C2=A0=C2=A0</div><d=
iv><br></div><div>Server: 19c [where sqlplus was run]</div><div>cx_Oracle: =
8.1 [different host from the server; using same DSN as sqlplus]</div><div><=
br></div><div>Thanks.</div></div>
_______________________________________________<br>
cx-oracle-users mailing list<br>
<a href=3D"mailto:cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" target=3D"_blank">=
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/cx-oracle-users" re=
l=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/list=
info/cx-oracle-users</a><br>
</blockquote></div>

--0000000000007cbd6e05c16fc9d3--


--===============1038631503664953914==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1038631503664953914==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users

--===============1038631503664953914==--