User Guide

Table Of Contents
348 Chapter 15: Using Persistent Data and Locking
If ColdFusion can identify that the database you are using supports SQL creation of database
tables, you only need to 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, you must use your database tool to create the client
variable tables. Create the CDATA and CGLOBAL tables.
The CDATA table must have the following columns:
The CGLOBAL table must have the following columns:
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, you should also 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
cfapplication tag clientStorage attribute.
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";
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
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