
Troubleshooting common problems
407
Problem
: You suspect that there are problems with the structure or contents of a complex data
variable, such as a structure, array, query object, or WDDX-encoded variable.
Use the
cfdump
tag to generate a table-formatted display of the variable’s structure and contents.
For example, to dump a structure named
relatives
, use the following line. You must surround
the variable name with pound signs (#).
<cfdump var=#relatives#>
Data source access and queries
Problem
: You cannot make a connection to the database.
You must create the data source before you can connect. Connection errors can include problems
with the location of files, network connections, and database client library configuration.
Create data sources before you refer to them in your application source files. Verify that you can
connect to the database by clicking the Verify button on the Data Sources page of the ColdFusion
MX Administrator. If you are unable to make a simple connection from that page, you might
need to consult your database administrator to help solve the problem.
Also, check the spelling of the data source name.
Problem
: Queries take too long.
Copy and paste the query from the Queries section of the debugging output into your database's
query analysis tool. Then retrieve and analyze the execution plan generated by the database
server's query optimizer. (The method for doing this varies from dbms to dbms.) The most
common cause of slow queries is the lack of a useful index to optimize the data retrieval. In
general, avoid table scans (or "clustered index" scans) whenever possible.
HTTP/URL
Problem
: ColdFusion MX cannot correctly decode the contents of your form submission.
The
method
attribute in forms sent to the ColdFusion server must be Post, for example:
<form action="test.cfm" method="Post">
Problem
: The browser complains or does not send the full URL string when you include spaces
in URL parameters.
Some browsers automatically replace spaces in URL parameters with the %20 escape sequence,
but others might display an error or just send the URL string up to the first character (as does
Netscape 4.7).
URL strings cannot have embedded spaces. Use a plus sign (+) or the standard HTTP space
character escape sequence, (%20) wherever you want to include a space. ColdFusion correctly
translates these elements into a space.
A common scenario in which this error occurs is when you dynamically generate your URL from
database text fields that have embedded spaces. To avoid this problem, include only numeric
values in the dynamically generated portion of URLs.
Or, you can use the
URLEncodedFormat
function, which automatically replaces spaces with %20
escape sequences. For more information on the
URLEncodedFormat
function, see
CFML
Reference
.
Summary of Contents for ColdFusion MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......