1.0

Table Of Contents
Other (non-"feed") clients should connect to the distributed cache cluster as non-peers (see SQLFire Cache
Strategies on page 173).
Note:
In a partitioned caching application, updates to distributed data are synchronously or asynchronously
propagated to a backend database server using the SQLFire caching framework (see SQLFire Cache
Strategies on page 173).
Example Code for Embedding SQLFire Members
If your application embeds a SQLFire member of any type (a peer client, server, or locator), you should use the
FabricServiceManager API to embed the required type. The application should embed SQLFire in the
main thread before any other thread attempts to connect to the cluster. Starting SQLFire Servers with the
FabricServer Interface on page 101 summarizes the steps involved in using the FabricServiceManager
API.
For example, to embed a SQLFire locator inside an application:
Properties props = new Properties();
// add desired properties if required.
FabricLocator locator = FabricServiceManager.getFabricLocatorInstance();
locator.start(localhost, 22343, props);
A second application could use the above locator for discover. This example code connects using a locator, and
also adds the embedded SQLFire member to server groups "sg1" and "sg2:"
Properties props = new Properties();
// add desired properties if required.
props.setProperty("server-groups", sg1,sg2);
props.setProperty("locators", localhost[22343]);
props.setProperty(host-data, true); // not required as the default
// is true
FabricServer server = FabricServiceManager.getFabricServerInstance();
server.start(props);
203
SQLFire Deployment Models