MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 342

Developing coldfusion mx applications
Table of Contents

Advertisement

<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td>Select a color.</td>
<td><select type="Text" name="color">
<option>red
<option>white
<option>blue
<option>turquoise
<option>black
<option>forest green
</select>
</td>
</tr>
<tr>
<td>Select a size.</td>
<td><select type="Text" name="size">
<option>small
<option>medium
<option>large
<option>xlarge
</select>
</td>
</tr>
<tr>
<td></td>
<td><input type="Submit" name="submit" value="Submit">
</td>
</tr>
</table>
</form>
</cfif>
</body>
</html>
Note: In this simple example, the Application.cfm page displays the Application.number variable
value. Because the Application.cfm file is processed before any code on each ColdFusion page, the
number that displays after you click the submit button does not include the new order. One way you
can resolve this problem is by using the OnRequestEnd.cfm page to display the value at the bottom
of each page in the application.
Example of synchronizing access to a file system
The following example shows how to use a
The
tag protects a
cflock
writing by the same tag executing on another request.
If an append operation takes more than 30 seconds, a request waiting to obtain an exclusive lock
to this code might time out. Also, this example uses a dynamic value for the
a different lock controls access to each file. As a result, locking access to one file does not delay
access to any other file.
<cflock name=#filename# timeout=30 type="Exclusive">
<cffile action="Append"
file=#fileName#
output=#textToAppend#>
</cflock>
342
Chapter 15: Using Persistent Data and Locking
cflock
tag from attempting to append data to a file already open for
cffile
block to synchronize access to a file system.
attribute so that
name

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion mx

Table of Contents