1.1.1

Table Of Contents
A comma-separated list of server group names. SQLFire deploys the event listener
implementation on all peers in the specied server group(s).
Note: The specied server groups must contain at least one data store member
at the time you execute the CREATE ASYNCEVENTLISTENER statement.
Note: When you deploy an event listener (or DBSynchronizer) to listen for
asynchronous events, specify a server group that contains no more than 2 data
stores. SQLFire automatically designates one of the listeners as a "primary," and
the remaining listeners become "secondaries". Every additional "secondary" can
slow down the publisher. By default all SQLFire members that store data are
members of a single "default" server group.
Examples
Install a basic AsyncEventListener implementation:
CREATE ASYNCEVENTLISTENER MyListener
(
LISTENERCLASS 'user.application.TestAsyncEventListener'
INITPARAMS ''
) SERVER GROUPS ( SG1 );
Install a DBSynchronizer conguration with a persistent event queue:
CREATE ASYNCEVENTLISTENER mydbsynch
(
LISTENERCLASS 'com.vmware.sqlfire.callbacks.DBSynchronizer'
INITPARAMS
'org.apache.derby.jdbc.EmbeddedDriver,jdbc:derby:newDB;create=true;'
ENABLEPERSISTENCE true
DISKSTORENAME mystore
)
SERVER GROUPS (primary_listener_group);
Install another DBSynchronizer for failover:
CREATE ASYNCEVENTLISTENER mydbsynch
(
LISTENERCLASS 'com.vmware.sqlfire.callbacks.DBSynchronizer'
INITPARAMS
'org.apache.derby.jdbc.EmbeddedDriver,jdbc:derby:newDB;create=true;'
ENABLEPERSISTENCE true
DISKSTORENAME mystore
)
SERVER GROUPS (secondary_listener_group);
Create a new table and attach the installed DBSynchronizer:
CREATE TABLE TESTTABLE (ID INT NOT NULL,
NAME VARCHAR(10))
ASYNCEVENTLISTENER(mydbsynch);
Note: You can optionally install the AsyncEventListener conguration after you
associate a table with the listener name. Make sure that you use the same listener
479
SQL Language Reference