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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple users updating an Access DB Through ColdFusion

Status
Not open for further replies.

Ish

Programmer
Joined
Oct 11, 2001
Messages
1
Location
US
How can I allow only one user at a time to update a record in Access through Coldfusion (record locking)

P.S.

I am brand new to Coldfusion and I do not have any training. All help on this subject would be much appreciated.
 
You can use CFLOCK:

<CFLOCK
TIMEOUT=&quot;timeout in seconds &quot;
SCOPE=&quot;Application&quot; or &quot;Server&quot; or &quot;Session&quot;
NAME=&quot;lockname&quot;
THROWONTIMEOUT=&quot;Yes/No&quot;
TYPE= &quot;ReadOnly/Exclusive &quot;>
<!--- CFML to be synchronized --->
</CFLOCK>

John Hoarty
jhoarty@quickestore.com
 
a question related to this topic: in my cf documentation is specified that cflock should be used whenever session or application variables are used;
therefore, I am assuming that when database is accessed through cfquery, the database itself will have locking mechanism (the cflock is not needed when cfquery is used) to protect data from being corrupted.

Is that assumption correct? Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
You know, you're right. There's another setting that specifies the number of simultaneous requests to the database. My understanding is that you can leave this number at the default, which is five (I think), or you can set it to one. If you set it to one, you are in effect letting Cold Fusion handle the queueing up and execution of requests, and it will handle them one at a time. I hear Cold Fusion is actually better at this than Access anyway.

You might also consider using CFTRANSACTION to maintain data integrity and appropriate grouping over multiple requests by a single user. John Hoarty
jhoarty@quickestore.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top