Ok well in general the policy of the Session is not to blow away any  
of your local changes to objects unless you specifically tell it to  
refresh (or use that goofy always_refresh flag that I guess youre  
using....), so id like Query.get/select etc. to load the object (and  
if you want to insure a reload use load()), and session.lock to  
strictly do a pass on the table for an existing object.  this doesnt  
prohibit you from reaching out of the transaction to get the current  
data, just use load() or always_refresh.

So....the select() needs to handle "nowait", for which ansisql.py  
doesnt actually add the "nowait" in, and oracle.py will intercept and  
add the "nowait" clause (if thats the case that only oracle supports  
that keyword.  if its standard SQL, then it goes in ansisql.py).

anyway...either you or andrija or whoever else wants to contribute is  
free to take a crack at it...you can post the patches to the trac  
ticket.   i just take in the patches on this end :)


On Sep 4, 2006, at 4:51 PM, Mike Bernson wrote:

> the question about refresh is that the select for lock at least on  
> mysql
> will read the record and use the copy stored in the database
> even if not the same as the one in transaction. Since I have set the
> refresh always to true this does not matter to me for now.
>
> I will be willing to get the query object to handle the lockmode for
> parameter. I can at least get the lockmodes for mysql working. After
> the query object handles the lockmode I can look at getting the patch
> for the session object as well.
>
> Does select off the table handle nowait ?
>
> I will look at how the select off the table handle for_update and use
> that as a template for dealing with query select/load/get stuff.
>
> Please let me known you want me to handle it or Andrija ?
>
> 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


-------------------------------------------------------------------------
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

Reply via email to