1.1

Table Of Contents
For example, if you specify EXPIRE TABLE WITH TIMETOLIVE secs ACTION DESTROY, then SQLFire
destroys the entire table if there have been no writes to the table for the specied number of seconds. Similarly
for EXPIRE ENTRY WITH IDLETIME secs ACTION DESTROY, SQLFire destroys a table entry if the
entry has been not updated for the congured number seconds.
PERSISTENT Clause
When you specify the PERSISTENT keyword, SQLFire persists the table to disk. The PERSISTENT keyword
is generally used with an existing 'disk-store-name' to use for persisting the data. If you do not specify a named
disk store, SQLFire persists the table in the default disk store.
Syntax
[ PERSISTENT [ 'disk-store-name' ] [ ASYNCHRONOUS | SYNCHRONOUS ] ]
Description
When you use the PERSISTENT keyword, you can also use the ASYNCHRONOUS or SYNCHRONOUS
keyword to specify how SQLFire should write table data to the disk store.
Caution: When tables are replicated or partitioned with redundancy, SQLFire persists the data on disk
for each copy independently. All disk storage is owned by each member and there is nothing shared at
the storage level. The advantage is higher availability and there are no restrictions on the disk storage
layer. But when multiple copies are stored on disk, SQLFire has to ensure the data consistency for each
replica at all times. This includes the case when members go down in a arbitrary order and come back up
again in a arbitrary order. To ensure consistency, SQLFire requires each persistent member to come up
before the data member becomes available.
See CREATE DISKSTORE on page 465.
See Using Disk Stores to Persist Data on page 77.
The SYNCHRONOUS and ASYNCHRONOUS attributes specify whether the data has to be written synchronously
or asynchronously to the disk store. For ASYNCHRONOUS writes, SQLFire uses additional attributes in the
associated disk store to congure the write behavior. See CREATE DISKSTORE on page 465.
Example with PERSISTENT Clause
CREATE TABLE FLIGHTS
(
FLIGHT_ID CHAR(6) NOT NULL,
SEGMENT_NUMBER INTEGER NOT NULL,
ORIG_AIRPORT CHAR(3),
DEPART_TIME TIME,
DEST_AIRPORT CHAR(3),
ARRIVE_TIME TIME,
MEAL CHAR(1) CONSTRAINT MEAL_CONSTRAINT
CHECK (MEAL IN ('B', 'L', 'D', 'S')),
PRIMARY KEY (FLIGHT_ID, SEGMENT_NUMBER)
)
PERSISTENT ASYNCHRONOUS
CREATE TRIGGER
A trigger denes a set of actions that are executed when a delete, insert, or update operation is performed on a
table. For example, if you dene a trigger for a delete on a particular table, the trigger's action occurs whenever
someone deletes a row or rows from the table.
491
SQL Language Reference