Manlio Perillo wrote:
try:
conn = db.connect()
i = a.insert()
conn.execute(i, x=6, y=5)
op = (a.c.x / a.c.y).label('z')
query = select([op], order_by=[op], use_labels=True)
result = conn.execute(query).fetchall()
for r in result:
print r
finally:
metadata.drop_all()
at the point of metadata.drop_all(), conn is still checked out from the
connection pool (and also 'result' holds a reference to it, even if
'conn' was not explicit). the drop_all uses a different connection
from the pool, and therefore the table is still locked since 'conn'
just operated upon it.
two solutions: conn.close() first, or
metadata.drop_all(connectable=conn)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---