a missing cursor.close() here caused a *huge* amount of weird locking issues with pypy,

what is strange is how it only occurred in some very specific places under very
particular conditions, perhaps it has to do with whether or not this cursor gets
gc'ed or not.
This commit is contained in:
Mike Bayer
2013-08-02 13:27:30 -04:00
parent 31ec1fc85e
commit 58b4b88907
+10 -7
View File
@@ -263,14 +263,17 @@ class DefaultDialect(interfaces.Dialect):
cast_to = util.text_type
cursor = connection.connection.cursor()
cursor.execute(
cast_to(
expression.select([
expression.literal_column("'x'").label("some_label")
]).compile(dialect=self)
try:
cursor.execute(
cast_to(
expression.select([
expression.literal_column("'x'").label("some_label")
]).compile(dialect=self)
)
)
)
return isinstance(cursor.description[0][0], util.text_type)
return isinstance(cursor.description[0][0], util.text_type)
finally:
cursor.close()
def type_descriptor(self, typeobj):
"""Provide a database-specific :class:`.TypeEngine` object, given