1
:연결 개체를 호출하지 - SQLAlchemy의/pymysql 내가 SQLAlchemy의와 pymysql로 연결 풀링을 구현하기 위해 노력하고
import pymysql
import sqlalchemy.pool as pool
# Lifted from the pymysql docs: https://github.com/PyMySQL/PyMySQL/blob/master/example.py
cnx = pymysql.connect(host='localhost',user='xxxx',password='xxxx',db='mydatabase')
# Lifted straight from the SQLAlchemy docs http://docs.sqlalchemy.org/en/latest/core/pooling.html:
cnxPool = pool.QueuePool(cnx, max_overflow=10, pool_size=5)
conn = cnxPool.connect()
cursor = conn.cursor()
cursor.execute("select * from PUBLIC_URLS")
cursor.close()
단순히 상당히 긴 스택 추적의 맨 아래에 다음과 같은 오류가 발생합니다 :
File "/usr/local/lib/python2.7/dist-packages/SQLAlchemy-1.1.3-py2.7-linux-x86_64.egg/sqlalchemy/pool.py", line 279, in <lambda> return lambda crec: creator() TypeError: 'Connection' object is not callable
무엇이 잘못 되었습니까?
감사
아, 그것 뿐이다. 감사 –