Re: Cursor_InternalExecute invoking did not return

Anthony Tuininga <[email protected]> Thu, 2 Mar 2017 08:52:04 -0700
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAE1XR-78cTxRxJAZvhP13TYx4PqS9Yw0hvSTo8tBz4GyXFjJPA@mail.gmail.com>
Hi Joshua,

The function Cursor_InternalExecute() will not return until the command has
been completed. If you are dealing with a large amount of data it might
just be taking a long time to do its work. The other possibility is that
something in the database is blocking your statement from executing. You
can examine the table dba_locks and v$session to see what is happening with
your session.

Anthony

On Thu, Mar 2, 2017 at 1:26 AM, [email protected] <
[email protected]> wrote:

> Hi folks,
>     Need you help. I wrote a python script to create several tables which
> select huge data from other tables in different python threads. I ran the
> script several times and it always turn out to unable to complete. So i ran
> gdb to check what the script was doing. The function stack show the
> Cursor_InternalExecute invoking did not return. I can't fix it then I see
> you help. The python code is like this:
>
> def split_credit(user_name, region_code):
>     with CDB(zc_dbUser, zc_dbPasswd, zc_dbCon) as db:   #thread's own
> cx_Oracle.Connection
>         credittable = "XXXX_XXXXX_08{0}".format(region_code)
>         creditsql = """CREATE TABLE XX.XX_XXXXX_08{0} tablespace {1} AS
>                         SELECT ....."""
>         db.tabledrop(user_name, credittable)
>         db.dosql(creditsql)
>         time.sleep(1)
>
> workers = []
> for i in range(0, 10):
>    region_code = "5"+str(i)
>    workerCredit= threading.Thread(target=split_credit,
> name="credit_"+region_code, args=(zc_dbUser, region_code))
>    workers.append(workerCredit)
>    workerCredit.start()
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> cx-oracle-users mailing list
> cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

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