On Fri, Jun 25, 2010 at 6:42 AM, Michael Bayer <mike...@zzzcomputing.com> wrote:
>
> On Jun 25, 2010, at 3:27 AM, Yang Zhang wrote:
>
>> How do I get the ORM to use locking selects when I do a
>> Session.query()?  E.g., select for update, or select for share
>> (PG)/select lock in share mode (MySQL).  I know this is possible using
>> the lower-level SQL expression library.  Thanks in advance.
>
> use query.with_lockmode().   The argument is passed down to the "for_update" 
> argument of select().
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
>
>

Thanks. Is there some way to have sqlalchemy always attach *at least*
a "for share"/"lock in share mode" when issuing queries?
-- 
Yang Zhang
http://yz.mit.edu/

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to