From 119674dd250d7da8be92a262ad53396c2fac4e0f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 6 Oct 2014 18:23:42 -0400 Subject: - The execution options passed to an :class:`.Engine` either via :paramref:`.create_engine.execution_options` or :meth:`.Engine.update_execution_options` are not passed to the special :class:`.Connection` used to initialize the dialect within the "first connect" event; dialects will usually perform their own queries in this phase, and none of the current available options should be applied here. In particular, the "autocommit" option was causing an attempt to autocommit within this initial connect which would fail with an AttributeError due to the non-standard state of the :class:`.Connection`. fixes #3200 --- lib/sqlalchemy/engine/strategies.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/sqlalchemy/engine') diff --git a/lib/sqlalchemy/engine/strategies.py b/lib/sqlalchemy/engine/strategies.py index 38206be89..49438372b 100644 --- a/lib/sqlalchemy/engine/strategies.py +++ b/lib/sqlalchemy/engine/strategies.py @@ -162,6 +162,7 @@ class DefaultEngineStrategy(EngineStrategy): def first_connect(dbapi_connection, connection_record): c = base.Connection(engine, connection=dbapi_connection, _has_events=False) + c._execution_options = {} dialect.initialize(c) event.listen(pool, 'first_connect', first_connect, once=True) -- cgit v1.2.1