Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 313

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
• Some browsers set a size limit of 4K bytes per cookie. ColdFusion encodes nonalphanumeric data in cookies with
a URL encoding scheme that expands at a 3-1 ratio, which means you should not store large amounts of data per
client. ColdFusion throws an error if you try to store more than 4,000 encoded bytes of data for a client.
Configuring database storage
When you specify a database for client variable storage, do not always have to manually create the data tables that store
the client variables.
If ColdFusion can identify that the database you are using supports SQL creation of database tables, create the database
in advance. When you click the Add button on the Select Data Source to Add as Client Store box on the Memory
Variables page, the Administrator displays a Add/Edit Client Store page which contains a Create Client Database
Tables selection box. Select this option to have ColdFusion create the necessary tables in your database. (The option
does not appear if the database already has the required tables.)
If your database does not support SQL creation of tables, or if you are using the ODBC socket [Macromedia] driver to
access your database, use your database tool to create the client variable tables. Create the CDATA and CGLOBAL
tables.
The CDATA table must have the following columns:
Column
Data type
cfid
CHAR(64), TEXT, VARCHAR, or any data type capable of taking variable length strings up to 64 characters
app
CHAR(64), TEXT, VARCHAR, or any data type capable of taking variable length strings up to 64 characters
data
MEMO, LONGTEXT, LONG VARCHAR, CLOB, or any data type capable of taking long, indeterminate-length strings
The CGLOBAL table must have the following columns:
Column
Data type
cfid
CHAR(64), TEXT, VARCHAR, or any data type capable of taking variable length strings up to 64 characters
data
MEMO, LONGTEXT, LONG VARCHAR, CLOB, or any data type capable of taking long, indeterminate-length strings
lvisit
TIMESTAMP, DATETIME, DATE, or any data type that stores date and time values
Note: Different databases use different names for their data types. The names in the preceding tables are common, but
your database might use other names.
To improve performance, create indexes when you create these tables. For the CDATA table, index these cfid and app
columns. For the CGLOBAL table, index the cfid column.
Specifying client variable storage in your application
The override the default client variable storage location, set the This.clientstorage variable in the Application.cfc
initialization code, or use the
The following lines from an Application.cfc file tell ColdFusion to store the client variables in the mydatasource data
source:
<cfscript>
This.name"SearchApp";
This.clientManagement="Yes";
This.clientStorage="mydatasource";
</cfscript>
tag
cfapplication
clientStorage
Last updated 1/20/2012
attribute.
308

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents