config.setDatabases(Arrays.asList(db1, db2));
config.setDialectFactory(new HSQLDBDialectFactory());
config.setDatabaseMetaDataCacheFactory(new SimpleDatabaseMetaDataCacheFactory());
config.setStateManagerFactory(factory);
// config.setDispatcherFactory(new JGroupsCommandDispatcherFactory());
config.setDurabilityFactory(new FineDurabilityFactory());
DataSource ds = new DataSource();
ds.setCluster("cluster");
ds.setConfigurationFactory(new SimpleDatabaseClusterConfigurationFactory<javax.sql.DataSource, DataSourceDatabase>(config));