We will need to add a new flag to the SQLAlchemy dialect that disallows any transaction calls of any kind including rollbacks on an autocommit connection since pyodbc is being buggy here.
On Wed, Sep 13, 2017 at 11:34 AM, Dirk Biesinger <dirk.biesin...@gmail.com> wrote: > Actually Mike, > > the error is with the create table statement that gets executed by > sqlalchemy.engine.base.Engine (the df.to_sql function has option > if_exists='append' set): > The table that is being created has different dataformat than the one that > exists. > This sql statement seems to be going thru, as the output continues > afterwards. > > I have to check on the datawarehouse server once I am in the office if the > create table statement did result in a new table or alterations to the > existing table. (I don't have the correct ip address range from home to be > able to connect to the server) > > > > On Wed, Sep 13, 2017 at 8:12 AM, Dirk Biesinger <dirk.biesin...@gmail.com> > wrote: >> >> Mike, >> >> for whatever reason the importlib.reload() did not actually reload the >> patched file. >> A fresh kernel did the trick. >> When using the engine.connect() function, I have a connection. >> When using the df.to_sql function I get a error message related to >> incorrect datatypes. >> I'd say this is success. >> I'll fix the datatypes issue and post an update. >> >> Thanks. >> >> Dirk Biesinger >> >> dirk.biesin...@gmail.com | 206.349.9769 >> >> "Simplicity is the Mastery of Complexity" >> >> On Tue, Sep 12, 2017 at 10:46 PM, Mike Bayer <mike...@zzzcomputing.com> >> wrote: >>> >>> On Tue, Sep 12, 2017 at 5:03 PM, Dirk Biesinger >>> <dirk.biesin...@gmail.com> wrote: >>> > >>> > >>> > Here's the new error stack: >>> >>> no this is wrong: >>> >>> >>> /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/base.py >>> in initialize(self, connection) >>> 1741 def initialize(self, connection): >>> -> 1742 super(MSDialect, self).initialize(connection) >>> 1743 self._setup_version_attributes() >>> >>> >>> /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> in initialize(self, connection) >>> 265 >>> --> 266 self.do_rollback(connection.connection) >>> 267 >>> >>> >>> /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> in do_rollback(self, dbapi_connection) >>> 439 def do_rollback(self, dbapi_connection): >>> --> 440 dbapi_connection.rollback() >>> 441 >>> >>> >>> do_rollback() is overridden with the patch, can't be called in >>> default.py. Please make sure the patch applies an empty >>> do_rollback() method to MSDialect_pyodbc. you're definitely using >>> "mssql+pyodbc://" style URL right? >>> >>> >>> >>> >>> >>> > >>> > 2017-09-12 21:01:39,990 INFO sqlalchemy.engine.base.Engine SELECT >>> > SERVERPROPERTY('ProductVersion') >>> > 2017-09-12 21:01:39,991 INFO sqlalchemy.engine.base.Engine () >>> > 2017-09-12 21:01:40,032 INFO sqlalchemy.engine.base.Engine SELECT >>> > schema_name() >>> > 2017-09-12 21:01:40,033 INFO sqlalchemy.engine.base.Engine () >>> > 2017-09-12 21:01:40,422 INFO sqlalchemy.engine.base.Engine SELECT >>> > CAST('test >>> > plain returns' AS VARCHAR(60)) AS anon_1 >>> > 2017-09-12 21:01:40,423 INFO sqlalchemy.engine.base.Engine () >>> > 2017-09-12 21:01:40,463 INFO sqlalchemy.engine.base.Engine SELECT >>> > CAST('test >>> > unicode returns' AS NVARCHAR(60)) AS anon_1 >>> > 2017-09-12 21:01:40,465 INFO sqlalchemy.engine.base.Engine () >>> > >>> > >>> > --------------------------------------------------------------------------- >>> > Empty Traceback (most recent call >>> > last) >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _do_get(self) >>> > 1121 wait = use_overflow and self._overflow >= >>> > self._max_overflow >>> > -> 1122 return self._pool.get(wait, self._timeout) >>> > 1123 except sqla_queue.Empty: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/queue.py >>> > in get(self, block, timeout) >>> > 144 if self._empty(): >>> > --> 145 raise Empty >>> > 146 elif timeout is None: >>> > >>> > Empty: >>> > >>> > During handling of the above exception, another exception occurred: >>> > >>> > ProgrammingError Traceback (most recent call >>> > last) >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> > in _wrap_pool_connect(self, fn, connection) >>> > 2146 try: >>> > -> 2147 return fn() >>> > 2148 except dialect.dbapi.Error as e: >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > unique_connection(self) >>> > 327 """ >>> > --> 328 return _ConnectionFairy._checkout(self) >>> > 329 >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _checkout(cls, pool, threadconns, fairy) >>> > 765 if not fairy: >>> > --> 766 fairy = _ConnectionRecord.checkout(pool) >>> > 767 >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > checkout(cls, pool) >>> > 515 def checkout(cls, pool): >>> > --> 516 rec = pool._do_get() >>> > 517 try: >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _do_get(self) >>> > 1137 with util.safe_reraise(): >>> > -> 1138 self._dec_overflow() >>> > 1139 else: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> > in __exit__(self, type_, value, traceback) >>> > 65 if not self.warn_only: >>> > ---> 66 compat.reraise(exc_type, exc_value, exc_tb) >>> > 67 else: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> > in reraise(tp, value, tb, cause) >>> > 186 raise value.with_traceback(tb) >>> > --> 187 raise value >>> > 188 >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _do_get(self) >>> > 1134 try: >>> > -> 1135 return self._create_connection() >>> > 1136 except: >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _create_connection(self) >>> > 332 >>> > --> 333 return _ConnectionRecord(self) >>> > 334 >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > __init__(self, pool, connect) >>> > 460 if connect: >>> > --> 461 self.__connect(first_connect_check=True) >>> > 462 self.finalize_callback = deque() >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > __connect(self, first_connect_check) >>> > 660 for_modify(pool.dispatch).\ >>> > --> 661 exec_once(self.connection, self) >>> > 662 if pool.dispatch.connect: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> > in exec_once(self, *args, **kw) >>> > 245 try: >>> > --> 246 self(*args, **kw) >>> > 247 finally: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> > in __call__(self, *args, **kw) >>> > 255 for fn in self.listeners: >>> > --> 256 fn(*args, **kw) >>> > 257 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> > in go(*arg, **kw) >>> > 1330 once_fn = once.pop() >>> > -> 1331 return once_fn(*arg, **kw) >>> > 1332 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py >>> > in first_connect(dbapi_connection, connection_record) >>> > 180 c._execution_options = util.immutabledict() >>> > --> 181 dialect.initialize(c) >>> > 182 event.listen(pool, 'first_connect', first_connect, >>> > once=True) >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py >>> > in initialize(self, connection) >>> > 164 # run other initialization which asks for user name, >>> > etc. >>> > --> 165 super(PyODBCConnector, self).initialize(connection) >>> > 166 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/base.py >>> > in initialize(self, connection) >>> > 1741 def initialize(self, connection): >>> > -> 1742 super(MSDialect, self).initialize(connection) >>> > 1743 self._setup_version_attributes() >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> > in initialize(self, connection) >>> > 265 >>> > --> 266 self.do_rollback(connection.connection) >>> > 267 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> > in do_rollback(self, dbapi_connection) >>> > 439 def do_rollback(self, dbapi_connection): >>> > --> 440 dbapi_connection.rollback() >>> > 441 >>> > >>> > ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 13 for SQL >>> > Server][SQL Server]111214;An attempt to complete a transaction has >>> > failed. >>> > No corresponding transaction found. (111214) (SQLEndTran)') >>> > >>> > The above exception was the direct cause of the following exception: >>> > >>> > ProgrammingError Traceback (most recent call >>> > last) >>> > <ipython-input-17-4e94acaff5d8> in <module>() >>> > 16 # dbapi_connection.autocommit = True >>> > 17 #cnxn = pyodbc.connect(connection_str) >>> > ---> 18 engn.connect() >>> > 19 #df.to_sql(tbl_server_out, engn, if_exists='append', >>> > index=False) >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> > in connect(self, **kwargs) >>> > 2089 """ >>> > 2090 >>> > -> 2091 return self._connection_cls(self, **kwargs) >>> > 2092 >>> > 2093 def contextual_connect(self, close_with_result=False, >>> > **kwargs): >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> > in __init__(self, engine, connection, close_with_result, _branch_from, >>> > _execution_options, _dispatch, _has_events) >>> > 88 else: >>> > 89 self.__connection = connection \ >>> > ---> 90 if connection is not None else >>> > engine.raw_connection() >>> > 91 self.__transaction = None >>> > 92 self.__savepoint_seq = 0 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> > in raw_connection(self, _connection) >>> > 2175 """ >>> > 2176 return self._wrap_pool_connect( >>> > -> 2177 self.pool.unique_connection, _connection) >>> > 2178 >>> > 2179 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> > in _wrap_pool_connect(self, fn, connection) >>> > 2149 if connection is None: >>> > 2150 >>> > Connection._handle_dbapi_exception_noconnection( >>> > -> 2151 e, dialect, self) >>> > 2152 else: >>> > 2153 util.reraise(*sys.exc_info()) >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> > in _handle_dbapi_exception_noconnection(cls, e, dialect, engine) >>> > 1463 util.raise_from_cause( >>> > 1464 sqlalchemy_exception, >>> > -> 1465 exc_info >>> > 1466 ) >>> > 1467 else: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> > in raise_from_cause(exception, exc_info) >>> > 201 exc_type, exc_value, exc_tb = exc_info >>> > 202 cause = exc_value if exc_value is not exception else None >>> > --> 203 reraise(type(exception), exception, tb=exc_tb, cause=cause) >>> > 204 >>> > 205 if py3k: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> > in reraise(tp, value, tb, cause) >>> > 184 value.__cause__ = cause >>> > 185 if value.__traceback__ is not tb: >>> > --> 186 raise value.with_traceback(tb) >>> > 187 raise value >>> > 188 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> > in _wrap_pool_connect(self, fn, connection) >>> > 2145 dialect = self.dialect >>> > 2146 try: >>> > -> 2147 return fn() >>> > 2148 except dialect.dbapi.Error as e: >>> > 2149 if connection is None: >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > unique_connection(self) >>> > 326 >>> > 327 """ >>> > --> 328 return _ConnectionFairy._checkout(self) >>> > 329 >>> > 330 def _create_connection(self): >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _checkout(cls, pool, threadconns, fairy) >>> > 764 def _checkout(cls, pool, threadconns=None, fairy=None): >>> > 765 if not fairy: >>> > --> 766 fairy = _ConnectionRecord.checkout(pool) >>> > 767 >>> > 768 fairy._pool = pool >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > checkout(cls, pool) >>> > 514 @classmethod >>> > 515 def checkout(cls, pool): >>> > --> 516 rec = pool._do_get() >>> > 517 try: >>> > 518 dbapi_connection = rec.get_connection() >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _do_get(self) >>> > 1136 except: >>> > 1137 with util.safe_reraise(): >>> > -> 1138 self._dec_overflow() >>> > 1139 else: >>> > 1140 return self._do_get() >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> > in __exit__(self, type_, value, traceback) >>> > 64 self._exc_info = None # remove potential circular >>> > references >>> > 65 if not self.warn_only: >>> > ---> 66 compat.reraise(exc_type, exc_value, exc_tb) >>> > 67 else: >>> > 68 if not compat.py3k and self._exc_info and >>> > self._exc_info[1]: >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> > in reraise(tp, value, tb, cause) >>> > 185 if value.__traceback__ is not tb: >>> > 186 raise value.with_traceback(tb) >>> > --> 187 raise value >>> > 188 >>> > 189 else: >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _do_get(self) >>> > 1133 if self._inc_overflow(): >>> > 1134 try: >>> > -> 1135 return self._create_connection() >>> > 1136 except: >>> > 1137 with util.safe_reraise(): >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > _create_connection(self) >>> > 331 """Called by subclasses to create a new >>> > ConnectionRecord.""" >>> > 332 >>> > --> 333 return _ConnectionRecord(self) >>> > 334 >>> > 335 def _invalidate(self, connection, exception=None): >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > __init__(self, pool, connect) >>> > 459 self.__pool = pool >>> > 460 if connect: >>> > --> 461 self.__connect(first_connect_check=True) >>> > 462 self.finalize_callback = deque() >>> > 463 >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> > in >>> > __connect(self, first_connect_check) >>> > 659 pool.dispatch.first_connect.\ >>> > 660 for_modify(pool.dispatch).\ >>> > --> 661 exec_once(self.connection, self) >>> > 662 if pool.dispatch.connect: >>> > 663 pool.dispatch.connect(self.connection, self) >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> > in exec_once(self, *args, **kw) >>> > 244 if not self._exec_once: >>> > 245 try: >>> > --> 246 self(*args, **kw) >>> > 247 finally: >>> > 248 self._exec_once = True >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> > in __call__(self, *args, **kw) >>> > 254 fn(*args, **kw) >>> > 255 for fn in self.listeners: >>> > --> 256 fn(*args, **kw) >>> > 257 >>> > 258 def __len__(self): >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> > in go(*arg, **kw) >>> > 1329 if once: >>> > 1330 once_fn = once.pop() >>> > -> 1331 return once_fn(*arg, **kw) >>> > 1332 >>> > 1333 return go >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py >>> > in first_connect(dbapi_connection, connection_record) >>> > 179 _has_events=False) >>> > 180 c._execution_options = util.immutabledict() >>> > --> 181 dialect.initialize(c) >>> > 182 event.listen(pool, 'first_connect', first_connect, >>> > once=True) >>> > 183 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py >>> > in initialize(self, connection) >>> > 163 >>> > 164 # run other initialization which asks for user name, >>> > etc. >>> > --> 165 super(PyODBCConnector, self).initialize(connection) >>> > 166 >>> > 167 def _dbapi_version(self): >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/base.py >>> > in initialize(self, connection) >>> > 1740 >>> > 1741 def initialize(self, connection): >>> > -> 1742 super(MSDialect, self).initialize(connection) >>> > 1743 self._setup_version_attributes() >>> > 1744 >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> > in initialize(self, connection) >>> > 264 self._description_decoder = >>> > self.description_encoding = >>> > None >>> > 265 >>> > --> 266 self.do_rollback(connection.connection) >>> > 267 >>> > 268 def on_connect(self): >>> > >>> > >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> > in do_rollback(self, dbapi_connection) >>> > 438 >>> > 439 def do_rollback(self, dbapi_connection): >>> > --> 440 dbapi_connection.rollback() >>> > 441 >>> > 442 def do_commit(self, dbapi_connection): >>> > >>> > ProgrammingError: (pyodbc.ProgrammingError) ('42000', '[42000] >>> > [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]111214;An attempt >>> > to >>> > complete a transaction has failed. No corresponding transaction found. >>> > (111214) (SQLEndTran)') >>> > >>> > >>> > >>> > On Tue, Sep 12, 2017 at 1:33 PM, Mike Bayer <mike...@zzzcomputing.com> >>> > wrote: >>> >> >>> >> On Tue, Sep 12, 2017 at 2:54 PM, Dirk Biesinger >>> >> <dirk.biesin...@gmail.com> wrote: >>> >> > nope, same result >>> >> >>> >> using raw pyodbc you don't have that problem? >>> >> >>> >> pyodbc would be screwing up here if it's in autocommit mode yet >>> >> connection.rollback() is doing something. please try patching as >>> >> follows: >>> >> >>> >> diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py >>> >> b/lib/sqlalchemy/dialects/mssql/pyodbc.py >>> >> index c6368f969..22adafa03 100644 >>> >> --- a/lib/sqlalchemy/dialects/mssql/pyodbc.py >>> >> +++ b/lib/sqlalchemy/dialects/mssql/pyodbc.py >>> >> @@ -289,4 +289,8 @@ class MSDialect_pyodbc(PyODBCConnector, >>> >> MSDialect): >>> >> version.append(n) >>> >> return tuple(version) >>> >> >>> >> + def do_rollback(self, connection): >>> >> + pass >>> >> + >>> >> + >>> >> dialect = MSDialect_pyodbc >>> >> >>> >> this is not a solution but a new feature would need to be added to the >>> >> dialect to force absolutely no rollback() calls, however pyodbc should >>> >> not need this if it's in autocommit. >>> >> >>> >> >>> >> >>> >> > >>> >> > P.S. that is why I try to always give feedback once a solution is >>> >> > found. >>> >> > There will be someone chasing the same problem. >>> >> > >>> >> > On Tue, Sep 12, 2017 at 11:51 AM, Dirk Biesinger >>> >> > <dirk.biesin...@gmail.com> >>> >> > wrote: >>> >> >> >>> >> >> I have this event listener already in the code (it's active). >>> >> >> >>> >> >> I'll give the ?autocommit=True in the create_engine a shot as well. >>> >> >> >>> >> >> >>> >> >> On Tue, Sep 12, 2017 at 11:38 AM, Mike Bayer >>> >> >> <mike...@zzzcomputing.com> >>> >> >> wrote: >>> >> >>> >>> >> >>> On Tue, Sep 12, 2017 at 1:56 PM, Dirk Biesinger >>> >> >>> <dirk.biesin...@gmail.com> wrote: >>> >> >>> > when executing the engine.connect() with >>> >> >>> > pool_reset_on_return=None >>> >> >>> > set >>> >> >>> >>> >> >>> OK there's a do_rollback in there that isn't controlled by this. >>> >> >>> So >>> >> >>> let's instead use the event hook that was on the issue to force no >>> >> >>> transactions: >>> >> >>> >>> >> >>> from sqlalchemy import create_engine, event >>> >> >>> >>> >> >>> engine = create_engine("mssql+pyodbc://...") >>> >> >>> >>> >> >>> >>> >> >>> @event.listens_for(engine, "connect") >>> >> >>> def _set_autocommit(dbapi_connection, connection_record): >>> >> >>> dbapi_connection.autocommit = True >>> >> >>> >>> >> >>> >>> >> >>> This is where the original poster fell silent, which tends to >>> >> >>> correlate to, "it's fixed". (note if this person had replied to >>> >> >>> my >>> >> >>> message, we would not have to have this long email thread now. ) >>> >> >>> >>> >> >>> I believe you can get the same result like this too: >>> >> >>> >>> >> >>> engine = create_engine("mssql+pyodbc://...?autocommit=true") >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> > >>> >> >>> > I get this error stack: >>> >> >>> > >>> >> >>> > 2017-09-12 17:53:37,807 INFO sqlalchemy.engine.base.Engine >>> >> >>> > SELECT >>> >> >>> > SERVERPROPERTY('ProductVersion') >>> >> >>> > 2017-09-12 17:53:37,808 INFO sqlalchemy.engine.base.Engine () >>> >> >>> > 2017-09-12 17:53:37,849 INFO sqlalchemy.engine.base.Engine >>> >> >>> > SELECT >>> >> >>> > schema_name() >>> >> >>> > 2017-09-12 17:53:37,850 INFO sqlalchemy.engine.base.Engine () >>> >> >>> > 2017-09-12 17:53:38,182 INFO sqlalchemy.engine.base.Engine >>> >> >>> > SELECT >>> >> >>> > CAST('test >>> >> >>> > plain returns' AS VARCHAR(60)) AS anon_1 >>> >> >>> > 2017-09-12 17:53:38,183 INFO sqlalchemy.engine.base.Engine () >>> >> >>> > 2017-09-12 17:53:38,230 INFO sqlalchemy.engine.base.Engine >>> >> >>> > SELECT >>> >> >>> > CAST('test >>> >> >>> > unicode returns' AS NVARCHAR(60)) AS anon_1 >>> >> >>> > 2017-09-12 17:53:38,231 INFO sqlalchemy.engine.base.Engine () >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > --------------------------------------------------------------------------- >>> >> >>> > Empty Traceback (most recent >>> >> >>> > call >>> >> >>> > last) >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _do_get(self) >>> >> >>> > 1121 wait = use_overflow and self._overflow >= >>> >> >>> > self._max_overflow >>> >> >>> > -> 1122 return self._pool.get(wait, self._timeout) >>> >> >>> > 1123 except sqla_queue.Empty: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/queue.py >>> >> >>> > in get(self, block, timeout) >>> >> >>> > 144 if self._empty(): >>> >> >>> > --> 145 raise Empty >>> >> >>> > 146 elif timeout is None: >>> >> >>> > >>> >> >>> > Empty: >>> >> >>> > >>> >> >>> > During handling of the above exception, another exception >>> >> >>> > occurred: >>> >> >>> > >>> >> >>> > ProgrammingError Traceback (most recent >>> >> >>> > call >>> >> >>> > last) >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> > in _wrap_pool_connect(self, fn, connection) >>> >> >>> > 2146 try: >>> >> >>> > -> 2147 return fn() >>> >> >>> > 2148 except dialect.dbapi.Error as e: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > unique_connection(self) >>> >> >>> > 327 """ >>> >> >>> > --> 328 return _ConnectionFairy._checkout(self) >>> >> >>> > 329 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _checkout(cls, pool, threadconns, fairy) >>> >> >>> > 765 if not fairy: >>> >> >>> > --> 766 fairy = _ConnectionRecord.checkout(pool) >>> >> >>> > 767 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > checkout(cls, pool) >>> >> >>> > 515 def checkout(cls, pool): >>> >> >>> > --> 516 rec = pool._do_get() >>> >> >>> > 517 try: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _do_get(self) >>> >> >>> > 1137 with util.safe_reraise(): >>> >> >>> > -> 1138 self._dec_overflow() >>> >> >>> > 1139 else: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> > in __exit__(self, type_, value, traceback) >>> >> >>> > 65 if not self.warn_only: >>> >> >>> > ---> 66 compat.reraise(exc_type, exc_value, >>> >> >>> > exc_tb) >>> >> >>> > 67 else: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> > in reraise(tp, value, tb, cause) >>> >> >>> > 186 raise value.with_traceback(tb) >>> >> >>> > --> 187 raise value >>> >> >>> > 188 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _do_get(self) >>> >> >>> > 1134 try: >>> >> >>> > -> 1135 return self._create_connection() >>> >> >>> > 1136 except: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _create_connection(self) >>> >> >>> > 332 >>> >> >>> > --> 333 return _ConnectionRecord(self) >>> >> >>> > 334 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > __init__(self, pool, connect) >>> >> >>> > 460 if connect: >>> >> >>> > --> 461 self.__connect(first_connect_check=True) >>> >> >>> > 462 self.finalize_callback = deque() >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > __connect(self, first_connect_check) >>> >> >>> > 660 for_modify(pool.dispatch).\ >>> >> >>> > --> 661 exec_once(self.connection, self) >>> >> >>> > 662 if pool.dispatch.connect: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> > in exec_once(self, *args, **kw) >>> >> >>> > 245 try: >>> >> >>> > --> 246 self(*args, **kw) >>> >> >>> > 247 finally: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> > in __call__(self, *args, **kw) >>> >> >>> > 255 for fn in self.listeners: >>> >> >>> > --> 256 fn(*args, **kw) >>> >> >>> > 257 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> > in go(*arg, **kw) >>> >> >>> > 1330 once_fn = once.pop() >>> >> >>> > -> 1331 return once_fn(*arg, **kw) >>> >> >>> > 1332 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py >>> >> >>> > in first_connect(dbapi_connection, connection_record) >>> >> >>> > 180 c._execution_options = >>> >> >>> > util.immutabledict() >>> >> >>> > --> 181 dialect.initialize(c) >>> >> >>> > 182 event.listen(pool, 'first_connect', >>> >> >>> > first_connect, >>> >> >>> > once=True) >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py >>> >> >>> > in initialize(self, connection) >>> >> >>> > 164 # run other initialization which asks for user >>> >> >>> > name, >>> >> >>> > etc. >>> >> >>> > --> 165 super(PyODBCConnector, >>> >> >>> > self).initialize(connection) >>> >> >>> > 166 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/base.py >>> >> >>> > in initialize(self, connection) >>> >> >>> > 1741 def initialize(self, connection): >>> >> >>> > -> 1742 super(MSDialect, self).initialize(connection) >>> >> >>> > 1743 self._setup_version_attributes() >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> > in initialize(self, connection) >>> >> >>> > 265 >>> >> >>> > --> 266 self.do_rollback(connection.connection) >>> >> >>> > 267 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> > in do_rollback(self, dbapi_connection) >>> >> >>> > 439 def do_rollback(self, dbapi_connection): >>> >> >>> > --> 440 dbapi_connection.rollback() >>> >> >>> > 441 >>> >> >>> > >>> >> >>> > ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 13 >>> >> >>> > for >>> >> >>> > SQL >>> >> >>> > Server][SQL Server]111214;An attempt to complete a transaction >>> >> >>> > has >>> >> >>> > failed. >>> >> >>> > No corresponding transaction found. (111214) (SQLEndTran)') >>> >> >>> > >>> >> >>> > The above exception was the direct cause of the following >>> >> >>> > exception: >>> >> >>> > >>> >> >>> > ProgrammingError Traceback (most recent >>> >> >>> > call >>> >> >>> > last) >>> >> >>> > <ipython-input-13-a41175de1d5e> in <module>() >>> >> >>> > 16 dbapi_connection.autocommit = True >>> >> >>> > 17 #cnxn = pyodbc.connect(connection_str) >>> >> >>> > ---> 18 engn.connect() >>> >> >>> > 19 #df.to_sql(tbl_server_out, engn, if_exists='append', >>> >> >>> > index=False) >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> > in connect(self, **kwargs) >>> >> >>> > 2089 """ >>> >> >>> > 2090 >>> >> >>> > -> 2091 return self._connection_cls(self, **kwargs) >>> >> >>> > 2092 >>> >> >>> > 2093 def contextual_connect(self, >>> >> >>> > close_with_result=False, >>> >> >>> > **kwargs): >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> > in __init__(self, engine, connection, close_with_result, >>> >> >>> > _branch_from, >>> >> >>> > _execution_options, _dispatch, _has_events) >>> >> >>> > 88 else: >>> >> >>> > 89 self.__connection = connection \ >>> >> >>> > ---> 90 if connection is not None else >>> >> >>> > engine.raw_connection() >>> >> >>> > 91 self.__transaction = None >>> >> >>> > 92 self.__savepoint_seq = 0 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> > in raw_connection(self, _connection) >>> >> >>> > 2175 """ >>> >> >>> > 2176 return self._wrap_pool_connect( >>> >> >>> > -> 2177 self.pool.unique_connection, _connection) >>> >> >>> > 2178 >>> >> >>> > 2179 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> > in _wrap_pool_connect(self, fn, connection) >>> >> >>> > 2149 if connection is None: >>> >> >>> > 2150 >>> >> >>> > Connection._handle_dbapi_exception_noconnection( >>> >> >>> > -> 2151 e, dialect, self) >>> >> >>> > 2152 else: >>> >> >>> > 2153 util.reraise(*sys.exc_info()) >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> > in _handle_dbapi_exception_noconnection(cls, e, dialect, engine) >>> >> >>> > 1463 util.raise_from_cause( >>> >> >>> > 1464 sqlalchemy_exception, >>> >> >>> > -> 1465 exc_info >>> >> >>> > 1466 ) >>> >> >>> > 1467 else: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> > in raise_from_cause(exception, exc_info) >>> >> >>> > 201 exc_type, exc_value, exc_tb = exc_info >>> >> >>> > 202 cause = exc_value if exc_value is not exception else >>> >> >>> > None >>> >> >>> > --> 203 reraise(type(exception), exception, tb=exc_tb, >>> >> >>> > cause=cause) >>> >> >>> > 204 >>> >> >>> > 205 if py3k: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> > in reraise(tp, value, tb, cause) >>> >> >>> > 184 value.__cause__ = cause >>> >> >>> > 185 if value.__traceback__ is not tb: >>> >> >>> > --> 186 raise value.with_traceback(tb) >>> >> >>> > 187 raise value >>> >> >>> > 188 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> > in _wrap_pool_connect(self, fn, connection) >>> >> >>> > 2145 dialect = self.dialect >>> >> >>> > 2146 try: >>> >> >>> > -> 2147 return fn() >>> >> >>> > 2148 except dialect.dbapi.Error as e: >>> >> >>> > 2149 if connection is None: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > unique_connection(self) >>> >> >>> > 326 >>> >> >>> > 327 """ >>> >> >>> > --> 328 return _ConnectionFairy._checkout(self) >>> >> >>> > 329 >>> >> >>> > 330 def _create_connection(self): >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _checkout(cls, pool, threadconns, fairy) >>> >> >>> > 764 def _checkout(cls, pool, threadconns=None, >>> >> >>> > fairy=None): >>> >> >>> > 765 if not fairy: >>> >> >>> > --> 766 fairy = _ConnectionRecord.checkout(pool) >>> >> >>> > 767 >>> >> >>> > 768 fairy._pool = pool >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > checkout(cls, pool) >>> >> >>> > 514 @classmethod >>> >> >>> > 515 def checkout(cls, pool): >>> >> >>> > --> 516 rec = pool._do_get() >>> >> >>> > 517 try: >>> >> >>> > 518 dbapi_connection = rec.get_connection() >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _do_get(self) >>> >> >>> > 1136 except: >>> >> >>> > 1137 with util.safe_reraise(): >>> >> >>> > -> 1138 self._dec_overflow() >>> >> >>> > 1139 else: >>> >> >>> > 1140 return self._do_get() >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> > in __exit__(self, type_, value, traceback) >>> >> >>> > 64 self._exc_info = None # remove potential >>> >> >>> > circular >>> >> >>> > references >>> >> >>> > 65 if not self.warn_only: >>> >> >>> > ---> 66 compat.reraise(exc_type, exc_value, >>> >> >>> > exc_tb) >>> >> >>> > 67 else: >>> >> >>> > 68 if not compat.py3k and self._exc_info and >>> >> >>> > self._exc_info[1]: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> > in reraise(tp, value, tb, cause) >>> >> >>> > 185 if value.__traceback__ is not tb: >>> >> >>> > 186 raise value.with_traceback(tb) >>> >> >>> > --> 187 raise value >>> >> >>> > 188 >>> >> >>> > 189 else: >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _do_get(self) >>> >> >>> > 1133 if self._inc_overflow(): >>> >> >>> > 1134 try: >>> >> >>> > -> 1135 return self._create_connection() >>> >> >>> > 1136 except: >>> >> >>> > 1137 with util.safe_reraise(): >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > _create_connection(self) >>> >> >>> > 331 """Called by subclasses to create a new >>> >> >>> > ConnectionRecord.""" >>> >> >>> > 332 >>> >> >>> > --> 333 return _ConnectionRecord(self) >>> >> >>> > 334 >>> >> >>> > 335 def _invalidate(self, connection, exception=None): >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > __init__(self, pool, connect) >>> >> >>> > 459 self.__pool = pool >>> >> >>> > 460 if connect: >>> >> >>> > --> 461 self.__connect(first_connect_check=True) >>> >> >>> > 462 self.finalize_callback = deque() >>> >> >>> > 463 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> > in >>> >> >>> > __connect(self, first_connect_check) >>> >> >>> > 659 pool.dispatch.first_connect.\ >>> >> >>> > 660 for_modify(pool.dispatch).\ >>> >> >>> > --> 661 exec_once(self.connection, self) >>> >> >>> > 662 if pool.dispatch.connect: >>> >> >>> > 663 pool.dispatch.connect(self.connection, >>> >> >>> > self) >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> > in exec_once(self, *args, **kw) >>> >> >>> > 244 if not self._exec_once: >>> >> >>> > 245 try: >>> >> >>> > --> 246 self(*args, **kw) >>> >> >>> > 247 finally: >>> >> >>> > 248 self._exec_once = True >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> > in __call__(self, *args, **kw) >>> >> >>> > 254 fn(*args, **kw) >>> >> >>> > 255 for fn in self.listeners: >>> >> >>> > --> 256 fn(*args, **kw) >>> >> >>> > 257 >>> >> >>> > 258 def __len__(self): >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> > in go(*arg, **kw) >>> >> >>> > 1329 if once: >>> >> >>> > 1330 once_fn = once.pop() >>> >> >>> > -> 1331 return once_fn(*arg, **kw) >>> >> >>> > 1332 >>> >> >>> > 1333 return go >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py >>> >> >>> > in first_connect(dbapi_connection, connection_record) >>> >> >>> > 179 _has_events=False) >>> >> >>> > 180 c._execution_options = >>> >> >>> > util.immutabledict() >>> >> >>> > --> 181 dialect.initialize(c) >>> >> >>> > 182 event.listen(pool, 'first_connect', >>> >> >>> > first_connect, >>> >> >>> > once=True) >>> >> >>> > 183 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py >>> >> >>> > in initialize(self, connection) >>> >> >>> > 163 >>> >> >>> > 164 # run other initialization which asks for user >>> >> >>> > name, >>> >> >>> > etc. >>> >> >>> > --> 165 super(PyODBCConnector, >>> >> >>> > self).initialize(connection) >>> >> >>> > 166 >>> >> >>> > 167 def _dbapi_version(self): >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/base.py >>> >> >>> > in initialize(self, connection) >>> >> >>> > 1740 >>> >> >>> > 1741 def initialize(self, connection): >>> >> >>> > -> 1742 super(MSDialect, self).initialize(connection) >>> >> >>> > 1743 self._setup_version_attributes() >>> >> >>> > 1744 >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> > in initialize(self, connection) >>> >> >>> > 264 self._description_decoder = >>> >> >>> > self.description_encoding = >>> >> >>> > None >>> >> >>> > 265 >>> >> >>> > --> 266 self.do_rollback(connection.connection) >>> >> >>> > 267 >>> >> >>> > 268 def on_connect(self): >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > >>> >> >>> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> > in do_rollback(self, dbapi_connection) >>> >> >>> > 438 >>> >> >>> > 439 def do_rollback(self, dbapi_connection): >>> >> >>> > --> 440 dbapi_connection.rollback() >>> >> >>> > 441 >>> >> >>> > 442 def do_commit(self, dbapi_connection): >>> >> >>> > >>> >> >>> > ProgrammingError: (pyodbc.ProgrammingError) ('42000', '[42000] >>> >> >>> > [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]111214;An >>> >> >>> > attempt >>> >> >>> > to >>> >> >>> > complete a transaction has failed. No corresponding transaction >>> >> >>> > found. >>> >> >>> > (111214) (SQLEndTran)') >>> >> >>> > >>> >> >>> > On Tue, Sep 12, 2017 at 10:52 AM, Mike Bayer >>> >> >>> > <mike...@zzzcomputing.com> >>> >> >>> > wrote: >>> >> >>> >> >>> >> >>> >> On Tue, Sep 12, 2017 at 1:14 PM, dirk.biesinger >>> >> >>> >> <dirk.biesin...@gmail.com> wrote: >>> >> >>> >> > Mike, >>> >> >>> >> > >>> >> >>> >> > I'll post two stacks: >>> >> >>> >> > the first one is just calling the engine.connect(): >>> >> >>> >> >>> >> >>> >> yup different error than before. >>> >> >>> >> >>> >> >>> >> Add pool_reset_on_return=None to your create_engine: >>> >> >>> >> >>> >> >>> >> e = create_engine(...., pool_reset_on_return=None) >>> >> >>> >> >>> >> >>> >> then try again. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> > the second one (look for a row of #####) is when calling the >>> >> >>> >> > df.to_sql() >>> >> >>> >> > function. >>> >> >>> >> > >>> >> >>> >> > 2017-09-12 17:08:23,572 INFO sqlalchemy.engine.base.Engine >>> >> >>> >> > SELECT >>> >> >>> >> > SERVERPROPERTY('ProductVersion') >>> >> >>> >> > 2017-09-12 17:08:23,573 INFO sqlalchemy.engine.base.Engine () >>> >> >>> >> > 2017-09-12 17:08:23,627 INFO sqlalchemy.engine.base.Engine >>> >> >>> >> > SELECT >>> >> >>> >> > schema_name() >>> >> >>> >> > 2017-09-12 17:08:23,627 INFO sqlalchemy.engine.base.Engine () >>> >> >>> >> > 2017-09-12 17:08:24,056 INFO sqlalchemy.engine.base.Engine >>> >> >>> >> > SELECT >>> >> >>> >> > CAST('test >>> >> >>> >> > plain returns' AS VARCHAR(60)) AS anon_1 >>> >> >>> >> > 2017-09-12 17:08:24,057 INFO sqlalchemy.engine.base.Engine () >>> >> >>> >> > 2017-09-12 17:08:24,117 INFO sqlalchemy.engine.base.Engine >>> >> >>> >> > SELECT >>> >> >>> >> > CAST('test >>> >> >>> >> > unicode returns' AS NVARCHAR(60)) AS anon_1 >>> >> >>> >> > 2017-09-12 17:08:24,117 INFO sqlalchemy.engine.base.Engine () >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > --------------------------------------------------------------------------- >>> >> >>> >> > Empty Traceback (most >>> >> >>> >> > recent >>> >> >>> >> > call >>> >> >>> >> > last) >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _do_get(self) >>> >> >>> >> > 1121 wait = use_overflow and self._overflow >= >>> >> >>> >> > self._max_overflow >>> >> >>> >> > -> 1122 return self._pool.get(wait, >>> >> >>> >> > self._timeout) >>> >> >>> >> > 1123 except sqla_queue.Empty: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/queue.py >>> >> >>> >> > in get(self, block, timeout) >>> >> >>> >> > 144 if self._empty(): >>> >> >>> >> > --> 145 raise Empty >>> >> >>> >> > 146 elif timeout is None: >>> >> >>> >> > >>> >> >>> >> > Empty: >>> >> >>> >> > >>> >> >>> >> > During handling of the above exception, another exception >>> >> >>> >> > occurred: >>> >> >>> >> > >>> >> >>> >> > ProgrammingError Traceback (most >>> >> >>> >> > recent >>> >> >>> >> > call >>> >> >>> >> > last) >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> >> > in _wrap_pool_connect(self, fn, connection) >>> >> >>> >> > 2146 try: >>> >> >>> >> > -> 2147 return fn() >>> >> >>> >> > 2148 except dialect.dbapi.Error as e: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > unique_connection(self) >>> >> >>> >> > 327 """ >>> >> >>> >> > --> 328 return _ConnectionFairy._checkout(self) >>> >> >>> >> > 329 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _checkout(cls, pool, threadconns, fairy) >>> >> >>> >> > 765 if not fairy: >>> >> >>> >> > --> 766 fairy = _ConnectionRecord.checkout(pool) >>> >> >>> >> > 767 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > checkout(cls, pool) >>> >> >>> >> > 515 def checkout(cls, pool): >>> >> >>> >> > --> 516 rec = pool._do_get() >>> >> >>> >> > 517 try: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _do_get(self) >>> >> >>> >> > 1137 with util.safe_reraise(): >>> >> >>> >> > -> 1138 self._dec_overflow() >>> >> >>> >> > 1139 else: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> >> > in __exit__(self, type_, value, traceback) >>> >> >>> >> > 65 if not self.warn_only: >>> >> >>> >> > ---> 66 compat.reraise(exc_type, exc_value, >>> >> >>> >> > exc_tb) >>> >> >>> >> > 67 else: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> >> > in reraise(tp, value, tb, cause) >>> >> >>> >> > 186 raise value.with_traceback(tb) >>> >> >>> >> > --> 187 raise value >>> >> >>> >> > 188 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _do_get(self) >>> >> >>> >> > 1134 try: >>> >> >>> >> > -> 1135 return self._create_connection() >>> >> >>> >> > 1136 except: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _create_connection(self) >>> >> >>> >> > 332 >>> >> >>> >> > --> 333 return _ConnectionRecord(self) >>> >> >>> >> > 334 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > __init__(self, pool, connect) >>> >> >>> >> > 460 if connect: >>> >> >>> >> > --> 461 self.__connect(first_connect_check=True) >>> >> >>> >> > 462 self.finalize_callback = deque() >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > __connect(self, first_connect_check) >>> >> >>> >> > 660 for_modify(pool.dispatch).\ >>> >> >>> >> > --> 661 exec_once(self.connection, self) >>> >> >>> >> > 662 if pool.dispatch.connect: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> >> > in exec_once(self, *args, **kw) >>> >> >>> >> > 245 try: >>> >> >>> >> > --> 246 self(*args, **kw) >>> >> >>> >> > 247 finally: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> >> > in __call__(self, *args, **kw) >>> >> >>> >> > 255 for fn in self.listeners: >>> >> >>> >> > --> 256 fn(*args, **kw) >>> >> >>> >> > 257 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> >> > in go(*arg, **kw) >>> >> >>> >> > 1330 once_fn = once.pop() >>> >> >>> >> > -> 1331 return once_fn(*arg, **kw) >>> >> >>> >> > 1332 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py >>> >> >>> >> > in first_connect(dbapi_connection, connection_record) >>> >> >>> >> > 180 c._execution_options = >>> >> >>> >> > util.immutabledict() >>> >> >>> >> > --> 181 dialect.initialize(c) >>> >> >>> >> > 182 event.listen(pool, 'first_connect', >>> >> >>> >> > first_connect, >>> >> >>> >> > once=True) >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py >>> >> >>> >> > in initialize(self, connection) >>> >> >>> >> > 164 # run other initialization which asks for >>> >> >>> >> > user >>> >> >>> >> > name, >>> >> >>> >> > etc. >>> >> >>> >> > --> 165 super(PyODBCConnector, >>> >> >>> >> > self).initialize(connection) >>> >> >>> >> > 166 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/base.py >>> >> >>> >> > in initialize(self, connection) >>> >> >>> >> > 1741 def initialize(self, connection): >>> >> >>> >> > -> 1742 super(MSDialect, self).initialize(connection) >>> >> >>> >> > 1743 self._setup_version_attributes() >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> >> > in initialize(self, connection) >>> >> >>> >> > 265 >>> >> >>> >> > --> 266 self.do_rollback(connection.connection) >>> >> >>> >> > 267 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> >> > in do_rollback(self, dbapi_connection) >>> >> >>> >> > 439 def do_rollback(self, dbapi_connection): >>> >> >>> >> > --> 440 dbapi_connection.rollback() >>> >> >>> >> > 441 >>> >> >>> >> > >>> >> >>> >> > ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver >>> >> >>> >> > 13 >>> >> >>> >> > for >>> >> >>> >> > SQL >>> >> >>> >> > Server][SQL Server]111214;An attempt to complete a >>> >> >>> >> > transaction >>> >> >>> >> > has >>> >> >>> >> > failed. >>> >> >>> >> > No corresponding transaction found. (111214) (SQLEndTran)') >>> >> >>> >> > >>> >> >>> >> > The above exception was the direct cause of the following >>> >> >>> >> > exception: >>> >> >>> >> > >>> >> >>> >> > ProgrammingError Traceback (most >>> >> >>> >> > recent >>> >> >>> >> > call >>> >> >>> >> > last) >>> >> >>> >> > <ipython-input-10-bd43083eb2bb> in <module>() >>> >> >>> >> > 16 dbapi_connection.autocommit = True >>> >> >>> >> > 17 #cnxn = pyodbc.connect(connection_str) >>> >> >>> >> > ---> 18 engn.connect() >>> >> >>> >> > 19 #df.to_sql(tbl_server_out, engn, if_exists='append', >>> >> >>> >> > index=False) >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> >> > in connect(self, **kwargs) >>> >> >>> >> > 2089 """ >>> >> >>> >> > 2090 >>> >> >>> >> > -> 2091 return self._connection_cls(self, **kwargs) >>> >> >>> >> > 2092 >>> >> >>> >> > 2093 def contextual_connect(self, >>> >> >>> >> > close_with_result=False, >>> >> >>> >> > **kwargs): >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> >> > in __init__(self, engine, connection, close_with_result, >>> >> >>> >> > _branch_from, >>> >> >>> >> > _execution_options, _dispatch, _has_events) >>> >> >>> >> > 88 else: >>> >> >>> >> > 89 self.__connection = connection \ >>> >> >>> >> > ---> 90 if connection is not None else >>> >> >>> >> > engine.raw_connection() >>> >> >>> >> > 91 self.__transaction = None >>> >> >>> >> > 92 self.__savepoint_seq = 0 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> >> > in raw_connection(self, _connection) >>> >> >>> >> > 2175 """ >>> >> >>> >> > 2176 return self._wrap_pool_connect( >>> >> >>> >> > -> 2177 self.pool.unique_connection, _connection) >>> >> >>> >> > 2178 >>> >> >>> >> > 2179 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> >> > in _wrap_pool_connect(self, fn, connection) >>> >> >>> >> > 2149 if connection is None: >>> >> >>> >> > 2150 >>> >> >>> >> > Connection._handle_dbapi_exception_noconnection( >>> >> >>> >> > -> 2151 e, dialect, self) >>> >> >>> >> > 2152 else: >>> >> >>> >> > 2153 util.reraise(*sys.exc_info()) >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> >> > in _handle_dbapi_exception_noconnection(cls, e, dialect, >>> >> >>> >> > engine) >>> >> >>> >> > 1463 util.raise_from_cause( >>> >> >>> >> > 1464 sqlalchemy_exception, >>> >> >>> >> > -> 1465 exc_info >>> >> >>> >> > 1466 ) >>> >> >>> >> > 1467 else: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> >> > in raise_from_cause(exception, exc_info) >>> >> >>> >> > 201 exc_type, exc_value, exc_tb = exc_info >>> >> >>> >> > 202 cause = exc_value if exc_value is not exception >>> >> >>> >> > else >>> >> >>> >> > None >>> >> >>> >> > --> 203 reraise(type(exception), exception, tb=exc_tb, >>> >> >>> >> > cause=cause) >>> >> >>> >> > 204 >>> >> >>> >> > 205 if py3k: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> >> > in reraise(tp, value, tb, cause) >>> >> >>> >> > 184 value.__cause__ = cause >>> >> >>> >> > 185 if value.__traceback__ is not tb: >>> >> >>> >> > --> 186 raise value.with_traceback(tb) >>> >> >>> >> > 187 raise value >>> >> >>> >> > 188 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py >>> >> >>> >> > in _wrap_pool_connect(self, fn, connection) >>> >> >>> >> > 2145 dialect = self.dialect >>> >> >>> >> > 2146 try: >>> >> >>> >> > -> 2147 return fn() >>> >> >>> >> > 2148 except dialect.dbapi.Error as e: >>> >> >>> >> > 2149 if connection is None: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > unique_connection(self) >>> >> >>> >> > 326 >>> >> >>> >> > 327 """ >>> >> >>> >> > --> 328 return _ConnectionFairy._checkout(self) >>> >> >>> >> > 329 >>> >> >>> >> > 330 def _create_connection(self): >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _checkout(cls, pool, threadconns, fairy) >>> >> >>> >> > 764 def _checkout(cls, pool, threadconns=None, >>> >> >>> >> > fairy=None): >>> >> >>> >> > 765 if not fairy: >>> >> >>> >> > --> 766 fairy = _ConnectionRecord.checkout(pool) >>> >> >>> >> > 767 >>> >> >>> >> > 768 fairy._pool = pool >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > checkout(cls, pool) >>> >> >>> >> > 514 @classmethod >>> >> >>> >> > 515 def checkout(cls, pool): >>> >> >>> >> > --> 516 rec = pool._do_get() >>> >> >>> >> > 517 try: >>> >> >>> >> > 518 dbapi_connection = rec.get_connection() >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _do_get(self) >>> >> >>> >> > 1136 except: >>> >> >>> >> > 1137 with util.safe_reraise(): >>> >> >>> >> > -> 1138 self._dec_overflow() >>> >> >>> >> > 1139 else: >>> >> >>> >> > 1140 return self._do_get() >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> >> > in __exit__(self, type_, value, traceback) >>> >> >>> >> > 64 self._exc_info = None # remove >>> >> >>> >> > potential >>> >> >>> >> > circular >>> >> >>> >> > references >>> >> >>> >> > 65 if not self.warn_only: >>> >> >>> >> > ---> 66 compat.reraise(exc_type, exc_value, >>> >> >>> >> > exc_tb) >>> >> >>> >> > 67 else: >>> >> >>> >> > 68 if not compat.py3k and self._exc_info and >>> >> >>> >> > self._exc_info[1]: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py >>> >> >>> >> > in reraise(tp, value, tb, cause) >>> >> >>> >> > 185 if value.__traceback__ is not tb: >>> >> >>> >> > 186 raise value.with_traceback(tb) >>> >> >>> >> > --> 187 raise value >>> >> >>> >> > 188 >>> >> >>> >> > 189 else: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _do_get(self) >>> >> >>> >> > 1133 if self._inc_overflow(): >>> >> >>> >> > 1134 try: >>> >> >>> >> > -> 1135 return self._create_connection() >>> >> >>> >> > 1136 except: >>> >> >>> >> > 1137 with util.safe_reraise(): >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > _create_connection(self) >>> >> >>> >> > 331 """Called by subclasses to create a new >>> >> >>> >> > ConnectionRecord.""" >>> >> >>> >> > 332 >>> >> >>> >> > --> 333 return _ConnectionRecord(self) >>> >> >>> >> > 334 >>> >> >>> >> > 335 def _invalidate(self, connection, >>> >> >>> >> > exception=None): >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > __init__(self, pool, connect) >>> >> >>> >> > 459 self.__pool = pool >>> >> >>> >> > 460 if connect: >>> >> >>> >> > --> 461 self.__connect(first_connect_check=True) >>> >> >>> >> > 462 self.finalize_callback = deque() >>> >> >>> >> > 463 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/pool.py >>> >> >>> >> > in >>> >> >>> >> > __connect(self, first_connect_check) >>> >> >>> >> > 659 pool.dispatch.first_connect.\ >>> >> >>> >> > 660 for_modify(pool.dispatch).\ >>> >> >>> >> > --> 661 exec_once(self.connection, self) >>> >> >>> >> > 662 if pool.dispatch.connect: >>> >> >>> >> > 663 >>> >> >>> >> > pool.dispatch.connect(self.connection, >>> >> >>> >> > self) >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> >> > in exec_once(self, *args, **kw) >>> >> >>> >> > 244 if not self._exec_once: >>> >> >>> >> > 245 try: >>> >> >>> >> > --> 246 self(*args, **kw) >>> >> >>> >> > 247 finally: >>> >> >>> >> > 248 self._exec_once = True >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/event/attr.py >>> >> >>> >> > in __call__(self, *args, **kw) >>> >> >>> >> > 254 fn(*args, **kw) >>> >> >>> >> > 255 for fn in self.listeners: >>> >> >>> >> > --> 256 fn(*args, **kw) >>> >> >>> >> > 257 >>> >> >>> >> > 258 def __len__(self): >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py >>> >> >>> >> > in go(*arg, **kw) >>> >> >>> >> > 1329 if once: >>> >> >>> >> > 1330 once_fn = once.pop() >>> >> >>> >> > -> 1331 return once_fn(*arg, **kw) >>> >> >>> >> > 1332 >>> >> >>> >> > 1333 return go >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py >>> >> >>> >> > in first_connect(dbapi_connection, connection_record) >>> >> >>> >> > 179 >>> >> >>> >> > _has_events=False) >>> >> >>> >> > 180 c._execution_options = >>> >> >>> >> > util.immutabledict() >>> >> >>> >> > --> 181 dialect.initialize(c) >>> >> >>> >> > 182 event.listen(pool, 'first_connect', >>> >> >>> >> > first_connect, >>> >> >>> >> > once=True) >>> >> >>> >> > 183 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py >>> >> >>> >> > in initialize(self, connection) >>> >> >>> >> > 163 >>> >> >>> >> > 164 # run other initialization which asks for >>> >> >>> >> > user >>> >> >>> >> > name, >>> >> >>> >> > etc. >>> >> >>> >> > --> 165 super(PyODBCConnector, >>> >> >>> >> > self).initialize(connection) >>> >> >>> >> > 166 >>> >> >>> >> > 167 def _dbapi_version(self): >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/base.py >>> >> >>> >> > in initialize(self, connection) >>> >> >>> >> > 1740 >>> >> >>> >> > 1741 def initialize(self, connection): >>> >> >>> >> > -> 1742 super(MSDialect, self).initialize(connection) >>> >> >>> >> > 1743 self._setup_version_attributes() >>> >> >>> >> > 1744 >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> >> > in initialize(self, connection) >>> >> >>> >> > 264 self._description_decoder = >>> >> >>> >> > self.description_encoding = >>> >> >>> >> > None >>> >> >>> >> > 265 >>> >> >>> >> > --> 266 self.do_rollback(connection.connection) >>> >> >>> >> > 267 >>> >> >>> >> > 268 def on_connect(self): >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > /home/saravji/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py >>> >> >>> >> > in do_rollback(self, dbapi_connection) >>> >> >>> >> > 438 >>> >> >>> >> > 439 def do_rollback(self, dbapi_connection): >>> >> >>> >> > --> 440 dbapi_connection.rollback() >>> >> >>> >> > 441 >>> >> >>> >> > 442 def do_commit(self, dbapi_connection): >>> >> >>> >> > >>> >> >>> >> > ProgrammingError: (pyodbc.ProgrammingError) ('42000', >>> >> >>> >> > '[42000] >>> >> >>> >> > [Microsoft][ODBC Driver 13 for SQL Server][SQL >>> >> >>> >> > Server]111214;An >>> >> >>> >> > attempt >>> >> >>> >> > to >>> >> >>> >> > complete a transaction has failed. No corresponding >>> >> >>> >> > transaction >>> >> >>> >> > found. >>> >> >>> >> > (111214) (SQLEndTran)') >>> >> >>> >> > >>> >> >>> >> > In [ ]: >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > ################################################################# >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> > 2017-09-12 17:12:13,839 INFO sqlalchemy.engine.base.Engine >>> >> >>> >> > SELECT >>> >> >>> >> > SERVERPROPERTY('ProductVersion') >>> >> >>> >> > 2017-09-12 17:12:13,840 INFO sqlalchemy.eng >> >> ... >> >> [Message clipped] > > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.