Skip to main content
Participant
August 25, 2010
Question

Preventing database race/ghosting conditions with CF?

  • August 25, 2010
  • 2 replies
  • 344 views

I'm not sure what the correct term is, but I am curious how to prevent over writing a table before a script is done with calculations and input.

For instance, say I deduct from a clients account right as they are making a deposit. Thus nullifiying the deposit they just made because my entry over wrote it will old data.

Is there a way to lock a particular mysql table to a coldfusion request until the request is complete?

    This topic has been closed for replies.

    2 replies

    SDEShawnAuthor
    Participant
    August 25, 2010

    So if you put a cftransaction at the beginning of your script and do a cfquery select at the begining. No other table can read from that table till the close of the cftransaction tag?

    Participating Frequently
    August 25, 2010

    Transactions are usually used to ensure that you have a consistent

    view of a database over multiple queries. Search google for

    transactions in general and the cftransaction ColdFusion tag.

    --

    Mack