Andrew Mobbs (mobbsy) wrote,
Andrew Mobbs

What I'd like is a database operation to say "on commit add n to whatever the value in this field is at the time" without needing to lock the row for the duration of the transaction, or perhaps more generally "perform function f this field on commit".

The specific use I have in mind is something like keeping account records where you unconditionally insert detailed records into one table and update a balance for an account, you don't care about ordering however you want the inserted records and balance to be consistent and it's expensive to lock the account record for the duration.

Sigh - that all looks a bit OODBMS doesn't it? I'm being turned to the dark side.

...actually, thinking a little more, it's just syntactic sugar for a batch of UPDATEs to be performed immediately before the commit.
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.