Hi !
I am pretty new to elixir..
So.. how can i lock some rows while updating them.

I've tried to do:

session.begin()
upd = MyClass.query().with_lockmode("update").one()
upd.somenumber += 10
session.commit()

but not successful. calling to session.begin() raise:

sqlalchemy.exc.InvalidRequestError: A transaction is already begun.
Use subtransactions=True to allow subtransactions.

and doing only:

upd = MyClass.query().with_lockmode("update").one()
upd.somenumber += 10
session.commit()

he doesn't lock.

what am i doing wrong? :S

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to