
272
DEVELOPING
COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Las
t
upda
te
d 8/5/2010
Limitations
•
File names/Directory names on RAM are case sensitive.
•
In-memory files must be accessed using mapping or absolute path. Relative paths to files/directories are not
supported.
•
Correct:
ram:///a/b/
•
Incorrect:
ram:///a/b/../..
•
You cannot access in-memory files using HTTP/HTTPS protocols. Instead, use
ram:///<file>
. For example,
ram:///a/b/test.cfm
.
•
DDX files and font files cannot be accessed as in-memory files.
•
The following functions are not supported for in-memory files.
•
FileSetAccessMode
that sets attributes of a file in Linux/Unix
•
FilesSetAttribute
that sets the attributes of a file in Windows
•
The following tags are not supported:
•
cfpdf
•
cfpdfform
•
The following scenarios are not supported:
•
The
cfreport
tag does not accept a template report on RAM. Therefore, the following does not work:
<cfreport format="PDF" template="ram:///myReport1.cfr" filename="ram:///test.pdf"
overwrite="yes">
In this case, the
myReport1.cfr
must reside on your disk.
•
The
cfimport
tag does not accept tag libraries on RAM. For instance, the following does not work:
<cfimport prefix="custom" taglib="ram:///a/b/mytags.jar">
•
Renaming across file systems (as shown in the following syntax) is not supported.
<cffile action="rename" source="ram:///src1/message2.txt"
destination="#ExpandPath('./')#/123.txt">.
Instead, you can move the files.
•
For the
cfexecute
tag, the executable cannot be on RAM and must be on your local file system. But the output
can be an in-memory file as illustrated in the following code:
<cfexecute name="C:\WINDOWS\System32\netstat.exe" arguments="-e"
outputFile="ram:///output.txt" timeout="1">
</cfexecute>
<cfset thisPath=ExpandPath("*.*")>
Optimizing database use
Poor database design and incorrect or inefficient use of the database are among the most common causes of inefficient
applications. Consider the different methods that are available for using databases and information from databases
when you design your application. For example, to average the price of many products from a SQL query, it is more
efficient to use SQL to get the average than to use a loop in ColdFusion.
Two important ColdFusion tools for optimizing your use of databases are the
cfstoredproc
tag and the
cfquery
tag
cachedWithin
attribute.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...