code: def autocommit(data_access):
    
    if not data_access.autocommit:
      data_access.commit()
    old_autocommit = data_access.autocommit
    data_access.autocommit = True
    try:
      yield data_access
    finally:
      data_access.autocommit = old_autocommit
docs: Make statements autocommit.
  
    :param data_access: a DataAccess instance