1.0

Table Of Contents
PERSISTENT Keyword
When you specify the PERSISTENT keyword, SQLFire persists the replicated or partitioned 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.
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. Always start SQLFire servers in the background (e.g. sqlf
server start -dir=server2 -port=1528 -mcast-port=33669 -rebalance & ).
See CREATE DISKSTORE on page 438.
See Using Disk Stores to Persist Data on page 69.
Example with PERSISTENT Keyword
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
ASYNCHRONOUS and SYNCHRONOUS Attributes
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 438.
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.
Syntax
CREATE TRIGGER trigger-name
{ AFTER | NO CASCADE BEFORE }
{ INSERT | DELETE | UPDATE [ OF column-name [, column-name]* ] }
ON table-name
[ ReferencingClause ]
vFabric SQLFire User's Guide464
vFabric SQLFire Reference