[cx-oracle-users] bug involving multiple IN/OUT parameters
Brought to you by:
atuining
From: Michael B. <mi...@zz...> - 2013-08-28 02:29:50
|
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}) |