Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection timeout #39

Closed
flakobatako opened this issue Jul 2, 2020 · 2 comments
Closed

Connection timeout #39

flakobatako opened this issue Jul 2, 2020 · 2 comments

Comments

@flakobatako
Copy link

I have a long time running SP call, the problem is that because it can take up to a couple of minutse, the connection gets lost somewhere in the middle.

I'm getting the following error saying that the transaction got aborted.
Fetch Failure: [Informix][Informix ODBC Driver][Informix]Long transaction aborted. SQLCODE=-458

Normally in other divers you can specify a timeout in the connection string so there won't be timeouts.

Is it possibly to do the same with IfxPy?

@jsagrera
Copy link
Collaborator

jsagrera commented Jul 2, 2020

Timeout in the connection string is usually just for the connection. The only timeout that can be a factor during a SQL execution is the SQL_ATTR_QUERY_TIMEOUT (Statement timeout) which from ODBC can be set with a call to SQLSetStmtAttr() call, but there is no option to set it up from IfxPy.
I'm pretty sure the default with ODBC is 0 (no TIMEOUT) so a SQL execution will wait forever (or until someone aborts the execution)

If the execution failed with a -458, the abort was not caused by a timeout, but due a long transaction.
You need to check why on the engine side, I suspect your SP is doing a lot of work that is filling up the logs. You won't be able to solve that on the client side (IfxPy/ODBC).

@flakobatako
Copy link
Author

flakobatako commented Jul 2, 2020

Thanks.

I did some research, and you are right.

I'm running an ETL, that inserts like 90000 + rows, but I empty the destination table in the begining of the SP execution, so i really don't need a transaction in this case. I activated the AUTOCOMMIT option and the problem was resolved.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants