Setting StaticPool in create_engine raises a AttributeError _on_first_connect

Issue #1615 resolved
Former user created an issue

I'm trying to use sqlite memory DB. In 0.5.4 it's working in 0.6beta1 it raises a AttributeError. I have attached my test script.

Traceback (most recent call last):
  File "bin/python", line 32, in <module>
    execfile(__file__)
  File "test.py", line 7, in <module>
    db = create_engine('sqlite://', poolclass=StaticPool, connect_args={'check_same_thread':False})
  File "/opt/develop/gamecore/src/SQLAlchemy/lib/sqlalchemy/engine/__init__.py", line 223, in create_engine
    return strategy.create(*args, **kwargs)
  File "/opt/develop/gamecore/src/SQLAlchemy/lib/sqlalchemy/engine/strategies.py", line 137, in create
    pool.add_listener({'first_connect':first_connect})
  File "/opt/develop/gamecore/src/SQLAlchemy/lib/sqlalchemy/pool.py", line 189, in add_listener
    self._on_first_connect.append(listener)
AttributeError: 'StaticPool' object has no attribute '_on_first_connect'

Comments (5)

  1. Log in to comment