Andrew Mobbs (mobbsy) wrote,
Andrew Mobbs
mobbsy

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

  • (no subject)

    Last week I poured the cremated remains of my father into a river. From there, that material will flow through the town he lived in, into the sea,…

  • Moving house!

    We're moving house soon… details to follow in a less public post, or email me. However, we're getting rid of some bits and pieces of…

  • (no subject)

    Yesterday, I made sausages. This was sufficiently exciting to cause me to actually write something on LJ for once. One of our wedding gifts was a…

  • Post a new comment

    Error

    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.
  • 6 comments