Thanks. You say you are not a fan. What is the preferred way to solve the problem I described?
On Jul 1, 3:22 am, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Jun 30, 7:05 pm, mc <[EMAIL PROTECTED]> wrote: > > > My problem is as follows: > > I select for something. > > If that row does not exists, I need to insert it. > > I want to avoid the situation where some other client inserts the row > > after I have selected (and found out it does not exist) but > > before I insert it myself. > > > In direct SQL, I would LOCK the table for WRITE before the select, and > > release the locks after the insert. > > > Can that be done through SQLAlchemy? > > im not a fan of pessimistic locking but you can issue "LOCK TABLE" on > the connection easily enough. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
