Ticket #1974 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

"Cannot operate on a closed database" with sqlalchemy-0.7.0

Reported by: dustin Owned by: dustin
Priority: blocker Milestone: 0.8.4
Version: master Keywords: database
Cc:

Description

(view as text)

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/Users/buildbot/slave/py27-sa070/build/master/buildbot/test/unit/test_db_pool.py", line 121, in tearDown
    native_tests.drop(bind=self.db_engine, checkfirst=True)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/schema.py", line 521, in drop
    bind.drop(self, checkfirst=checkfirst)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1976, in drop
    connection=connection, **kwargs)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2009, in _run_visitor
    **kwargs).traverse_single(element)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 86, in traverse_single
    return meth(obj, **kw)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py", line 154, in visit_table
    if not drop_ok and not self._can_drop_table(table):
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py", line 137, in _can_drop_table
    table.name, schema=table.schema)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/base.py", line 555, in has_table
    cursor = _pragma_cursor(connection.execute("%stable_info(%s)" % (pragma, qtable)))
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1294, in execute
    params)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1471, in _execute_text
    statement, parameters
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1494, in _execute_context
    None, None)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1490, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 514, in _init_statement
    self.cursor = self.create_cursor()
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 587, in create_cursor
    return self._dbapi_connection.cursor()
  File "/Users/buildbot/slave/py27-sa070/sandbox-python2.7-twisted-sqlalchemy==0.7.0/lib/python2.7/site-packages/sqlalchemy/pool.py", line 424, in cursor
    return self.connection.cursor(*args, **kwargs)
sqlalchemy.exc.ProgrammingError: (ProgrammingError) Cannot operate on a closed database. 'PRAGMA table_info("native_tests")' []

buildbot.test.unit.test_db_pool.Native.test_ddl_and_queries
-------------------------------------------------------------------------------
Ran 755 tests in 24.506s

FAILED (errors=1, successes=754)

Change History

comment:1 Changed 2 years ago by Dustin J. Mitchell

  • Status changed from new to closed
  • Resolution set to fixed

Don't try to clean up a closed memory DB

Fixes #1974.

Changeset: d8d4f2074d80fb508df62a7f813ef5d44ebb2e58

Note: See TracTickets for help on using tickets.