Commits

Mike Bayer committed b1dc6b9

moved rollback catch to mysql module...

  • Participants
  • Parent commits ab7fea8

Comments (0)

Files changed (2)

lib/sqlalchemy/databases/mysql.py

     def schemadropper(self, *args, **kwargs):
         return MySQLSchemaDropper(*args, **kwargs)
 
+    def do_rollback(self, connection):
+        # some versions of MySQL just dont support rollback() at all....
+        try:
+            connection.rollback()
+        except:
+            pass
+
     def get_default_schema_name(self):
         if not hasattr(self, '_default_schema_name'):
             self._default_schema_name = text("select database()", self).scalar()

lib/sqlalchemy/engine/default.py

         """implementations might want to put logic here for turning autocommit on/off,
         etc."""
         #print "ENGINE ROLLBACK ON ", connection.connection
-        try:
-            connection.rollback()
-        except:
-            pass
+        connection.rollback()
     def do_commit(self, connection):
         """implementations might want to put logic here for turning autocommit on/off, etc."""
         #print "ENGINE COMMIT ON ", connection.connection