we're going to take the "nowait" kwarg out and replace it with "for_update='nowait'". only the oracle dialect will pick up on the "nowait", the rest will fall back to regular FOR UPDATE. I think Andrija is posting a patch for this to the ticket.
the "lockmode" keyword argument is an object-relational concept, and will be local to the sqlalchemy.orm package; only Query and Session should really know about it. lets move the discussion over to the ticket itself at http:// www.sqlalchemy.org/trac/ticket/292 . On Sep 5, 2006, at 8:00 PM, Mike Bernson wrote: > I have starting look at the query object select statement. > > The select method accept for_update, and nowait in kwargs if the > arg does not have a _selectable attribute. Not sure what happens > down the other path. > > Since the select method already takes for_update and nowait keywords > because it self.compile use sql.select and passes in the keyword args. > > It is the self.compile that uses sql.select and that handles the > keyword > args. > > I can modify the sql.select to handle the lockmode as keyword arg > and then we have for_update, nowait and lockmode for dealing with > locking. > > If both lockmode and for_update, or nowait are use which one do we > take ? > > lockmode = None ---------for_update=False nowait=False > lockmode = read ---------for_update=read nowait=False > lockmode = upgrade-------for_update=True nowait=False > lockmode = update_nowait for_update=True nowaite=True > > should I add lockmode to sql.select ? > should I add for_update=read to handle lockmode=read ? > > Michael Bayer wrote: >> anyway, would either of you care to try creating patches for some of >> this ? if you can get the basic idea going I can clean up as >> necessary before committing. >> >> Id say its somewhat straightforward to get the "lockmode" argument >> into query.get/select, as well as getting Oracle to look for >> "for_update='nowait'". >> >> with regards to the lock() method, someone said that it should >> "refresh the object". i think Hibernate's policy is that it loads >> the object only if it has not been loaded already. if we refresh an >> already-loaded object, what happens to changes that have already been >> made on the instance ? >> >> to do session.lock, its essentially a call to query's _get with the >> proper arguments. id not worry about cascading to start with ( i can >> get cascading in later on). if we really want it to refresh (which >> im not so sure about), it involves sending the "refresh=True" flag to >> _get(). >> >> >> --------------------------------------------------------------------- >> ---- >> Using Tomcat but need to do more? Need to support web services, >> security? >> Get stuff done quickly with pre-integrated technology to make your >> job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel? >> cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> Sqlalchemy-users mailing list >> Sqlalchemy-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users