You gave unique=Truea name to the field, so when you try to commit it, it will launch an update request, it will cause an error.
, , . , , IntegrityError.
a = MyObject(name="Max")
b = MyObject(name="Moritz")
session.add_all([a, b])
session.commit()
atmp = a.name
btemp = b.name
a.name = a.name+btemp
session.commit()
b.name = atemp
a.name = btemp
session.commit()