From 1e229b3cfcde4927e8b6ffb5611dd46c031a5129 Mon Sep 17 00:00:00 2001 From: Josep Pascual Badia Date: Mon, 30 May 2022 12:56:02 +0200 Subject: [PATCH] Update connection.rst Fix a bug on reconnecting logic since at it is right now it is assigning the new connection to a new cursor but is till retrying on the old one. --- doc/build/faq/connections.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/build/faq/connections.rst b/doc/build/faq/connections.rst index d592ccf6dc..59db00c37b 100644 --- a/doc/build/faq/connections.rst +++ b/doc/build/faq/connections.rst @@ -281,7 +281,7 @@ statement executions:: trans.rollback() time.sleep(retry_interval) - context.cursor = cursor_obj = connection.connection.cursor() + context.cursor = cursor = connection.connection.cursor() else: raise else: @@ -290,15 +290,15 @@ statement executions:: e = engine.execution_options(isolation_level="AUTOCOMMIT") @event.listens_for(e, "do_execute_no_params") - def do_execute_no_params(cursor_obj, statement, context): + def do_execute_no_params(cursor, statement, context): return _run_with_retries( - context.dialect.do_execute_no_params, context, cursor_obj, statement + context.dialect.do_execute_no_params, context, cursor, statement ) @event.listens_for(e, "do_execute") - def do_execute(cursor_obj, statement, parameters, context): + def do_execute(cursor, statement, parameters, context): return _run_with_retries( - context.dialect.do_execute, context, cursor_obj, statement, parameters + context.dialect.do_execute, context, cursor, statement, parameters ) return e -- 2.47.3