Я обновляю строки в пользовательской таблице (sqlite3 и Python) с помощью
def update_user_by_id(self,id,first_name,last_name,username,password,privilege,email):
'''Update user in table user based on id on passed parameters'''
try:
connection=sqlite3.connect(self.__path_users)
cursor=connection.cursor()
cursor.execute('''UPDATE user SET first_name=?,last_name=?,username=?,password=?,privilege=?,email=? where id=?''',first_name,last_name,username,password,privilege,email,id)
connection.commit()
connection.close()
print "Affected: %d", cursor.rowcount
except sqlite3.Error, e:
print "Ooops:", e.args[0]
, но как поместить это в транзакцию?