bug involving multiple IN/OUT parameters

Michael Bayer <[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <[email protected]>
Hi all -

I've located what is either a bad limitation in OCI or a bug in cx_Oracle.  The nature of it is pretty hard to pin down, but I've produced a comprehensive demonstration here.  Against cx_Oracle 5.1.2, Python 2 or 3, the last statement will produce "ORA-24369: required callbacks not registered for one or more  bind handles" every time.  There seems to be something going on when you mix both IN/OUT params as well as multiple datatypes with at least one repeat (and then still not always?), it hoses out.

You can see that the previous three run cases make use of the exact same variables and constructs, just not all of them at the same time.

If anyone has insight into the nature of this bug that would be appreciated! 

- mike

import cx_Oracle

conn = cx_Oracle.connect("scott", "tiger", "xe")

cursor = conn.cursor()

try:
    cursor.execute("drop table t1")
except cx_Oracle.xbaseError:
    pass
cursor.execute("""
    CREATE TABLE t1 (
        x VARCHAR2(50),
        y INTEGER,
        z INTEGER
    )
""")

x = cursor.var(cx_Oracle.STRING)
y = cursor.var(cx_Oracle.NUMBER)
z = cursor.var(cx_Oracle.NUMBER)

# z=IN, x=OUT, works
for i in range(1, 5):
    cursor.execute(
            "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.x INTO :x",
            {"z": 1, "x": x})

# z=IN, y=OUT, works
for i in range(1, 5):
    cursor.execute(
            "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.y INTO :y",
            {"z": 1, "y": y})

# x=OUT, y=OUT, works
for i in range(1, 5):
    cursor.execute(
            "INSERT INTO t1 (y, z) VALUES (1, 1) RETURNING t1.x, t1.y INTO :x, :y",
            {"x": x, "y": y})


# z=IN, x=OUT, y=OUT, breaks every time in this case:
# ORA-24369 required callbacks
# not registered for one or more bind handles
# different combinations work/fail somewhat randomly, though deterministically
# for a given combination.
cursor.execute(
        "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.x, t1.y INTO :x, :y",
        {"z": 1, "x": x, "y": y})

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
signature.asc (application/pgp-signature, 495 B)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJSHVwEAAoJEDMCOcHE2v7hY6wH/1xSf4tnydqelYSA5tLWtNE/
xFdyf8ndkcpPB+SaLNslpCd4hl2H+lt8VBngF0O4179QH3CMcZaRKnd699WVCA9j
lpx64eFUd/Pvjr1NzZaXwTEmVN43rryPZfWlmbLrdG3BxKf+5RAzGAooS8yF6jBK
SyOzuGgBjhpvim8/AWczxKuYsORsnbMjp7AOskbMaH+tcmfAWMUMbSzu4WO/vnHk
g08SZzpw5C1AB8/WLfRZO1zl8BV58NLF43PMyxS51T6rvaQhYmLg7iyxIFaoyzc7
sJjDilA+FvN89KIlo9IntoE3huKa6tgauYEA8TI27Ypwk/33iArmeopG/qXGk18=
=m3M3
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.