first of all, the transaction should implement whatever locking
scenario the database implements, so depending on transaction isolation
settings, whatever goes on inside your transaction should be reasonably
isolated from other transactions.   however, if you really have this
insert/delete intensive environment, where you are going to have
concurrent connections updating rows that are dependent on rows that
some other process is deleting (an extremely rare scenario in
reasonable practice), then you have to go through some more effort for
that, namely doing everything inside of transactions, including
acquiring your user to be deleted (the example below also illustrates
"SELECT...FOR UPDATE", which ive never used...):

trans = session.create_transaction()
try:
    user = session.query(User).with_lockmode('update').get(someid)
    session.delete(user)
    trans.commit()
except:
    trans.rollback()


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to