Re: [cx-oracle-users] cx-oracle-users Digest, Vol 64, Issue 3
Brought to you by:
atuining
From: Wong W. Meng-R. <r3...@fr...> - 2011-10-10 03:12:01
|
GThomas, > > I am thinking my API might be using different connection objects to do the cursor.execute() and connection.commit(), respectively however the likelihood is low, as the old code using oracledb was working well. > I'm sure this is the case. You should use cursor.connection.commit() for commiting, not the other connection object! Or put an "assert conn == cursor.commit" somewhere... Ok I will work on based on this clue. I am thinking my application should use the same connection object throughout a single API. An API can execute x number of SQL query/insert/update/delete statements and if no exception is found, commit is issued at the end, otherwise rollback is issued. What I don't understand is the framework did not change, while I convert oracledb to cx_Oracle, so I wonder how each SQL in the same API transaction could be utilizing different connection objects. Another behavior I need to check is the threadSafe mode. I need to understand more on that option as I did not look into that aspect in this migration exercise. I only did one change i.e. adding on "threaded=True" to "cx_Oracle.connect()" when I spawn off multiple threads creating the connection objects. I will revert after researching and testing. Thanks! Regards, Wah Meng |