Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

integrity issue

Status
Not open for further replies.

Fujiko

Programmer
Dec 23, 2001
63
0
0
PH
Hi,

Im kinda newbie with this, but i'd like to know how i can work around this issue.

We have a database that stores a "value" that different peopel are retrieving. The query adds one to the current value and returns this new number to which it becomes the new value. To make sure that each user have a unique value, we wrap this query using cftransaction.. however, there is an integrity issue, when people access a section of the code at the same time as in at the same moment, it creates inconsistent data.

WHat's the best way to avoid this? what tags can I add? or is there any other attribute I should set with the cftransaction tag? Is it advisable to use cflock tag?

Thank you very much in advance!! :)
bebs
 
<cflock>

You can use the name attribute in this manner...

Code:
<cflock name="integ" timeout="30">
  ...code here...cf will only process one set of code by the name of "integ" at a time.. you can change the name, it doesn't matter...
</cflock>

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top