2

I'm trying to perform a cx_Oracle.execute(sql_string, sql_data_dict) command.

sql_string is my SQL query and it's something like INSERT INTO MY_TABLE(VAR1, VAR2) VALUES (:var1_, :var2_) and sql_data_dict is a dictionary containing variable defined in the query; something like this:

{var1_: "my_first_variable", var2_: "my_second_variable"}.

Python hangs on the command cx_Oracle.execute(sql_string, sql_data_dict). As I checked to debug inside the code, it appears that it doesn't go to the library to perform execute and I don't know why.

I also tried to use cursor.prepare as following:

cursor.prepare(sql_string)
cursor.execute(None, sql_data_dict)

But I had same result. Any help?

EDIT 1:

I should mention that I execute my query using Navicat and I have no problem. Additionally, there is no bug about SELECT statement, so it's just about INSERT already.

1 Answer 1

2

I googled for a couple of hours and then I realized it was just a server-side problem; since the server was overloaded, it had rejected some queries. So I should just say that there is nothing wrong with the code, it may occur when server's load gets huge.

Sign up to request clarification or add additional context in comments.

2 Comments

How did you know that the server is overloaded, I'm having the same problem but I am not sure if it's the same case.
@arsenbonbon, I have used this script to know how many parallel connections have been made to the database: select * from v$session where schemaname='SCHEMA_NAME'; .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.