Michael Bayer wrote:
> we've just added the atomic update thing to 0.4 (note the uppercase  
> Article which produces a column expression):
>
> article.comment_count = Article.comment_count + 1
> session.flush()
>   
That's great!
It's quite unconvenient here, but has a lot of good use cases.
> i wonder though if theres some way that could get "out of sync" with  
> the actual number.  you'd have to be careful to establish this  
> update.  if you wanted to use a mapper extension to do it, then youd  
> have to issue the UPDATE directly, the change to the "comment_count"  
> attribute wont get picked up if its established within the flush itself.
If you mean out of sync with article instance - it's not
a problem. If you have a highly concurent database you'll
get out of sync instances in any case, if not - field will be
quite up to date.

Well, while writing this e-mail I've realized that there can
be some problems with deletes and updates that probably
can make value out of sync.

I'll just try and give a feedback after that :)
--
Paul.





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