code: def commit(self):
          
          try:
              self.__dbapi2_conn.commit()
          except Exception, e:
              # try to reconnect
              self.reconnect(None)
              self.__dbapi2_conn.commit()
docs: As in DBAPI2.0:
          Commit any pending transaction to the database. Note that
          if the database supports an auto-commit feature, this must
          be initially off. An interface method may be provided to
          turn it back on.
  
          Database modules that do not support transactions should
          implement this method with void functionality.