Chapter 12: Using the Application Framework
<!--- Show the form only if it has not been submitted. --->
<CFELSE>
<FORM ACTION="cflock.cfm" METHOD="Post">
<P> Congratulations! You have just selected
the longest wearing, most comfortable turtleneck
in the world. Please indicate the color and size
you want to buy.</P>
<TABLE CELLSPACING="2" CELLPADDING="2" BORDER="0">
<TR>
<TD>Select a color.</TD>
<TD><SELECT TYPE="Text" NAME="color">
</TD>
</TR>
<TR>
<TD>Select a size.</TD>
<TD><SELECT TYPE="Text" NAME="size">
</TD>
</TR>
<TR>
<TD></TD>
<TD><INPUT TYPE="Submit" NAME="submit" VALUE="Submit">
</TD>
</TR>
</TABLE>
</FORM>
</CFIF>
</BODY>
</HTML>
Example of synchronizing access to a file system
The following example demonstrates how to use CFLOCK to synchronize access to a
file system. The CFLOCK tag protects a CFFILE tag from attempting to append data to
a file already open for writing by the same tag executing on another request.
Note that if an append operation takes more that one minute, a request waiting to
obtain an exclusive lock to the critical section may time out. Also, note the use of a
<OPTION>red
<OPTION>white
<OPTION>blue
<OPTION>turquoise
<OPTION>black
<OPTION>forest green
</SELECT>
<OPTION>small
<OPTION>medium
<OPTION>large
<OPTION>xlarge
</SELECT>
203
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?