// we use the writerInfo since this will not instantiate an publisher
I_Info tmpInfo = new PropertiesInfo((Properties)this.specificHelper.getProperties().clone());
setupProperties(null, tmpInfo, extraUser);
boolean forceCreationAndInit = true;
I_DbSpecific dbSpecific = ReplicationConverter.getDbSpecific(tmpInfo, forceCreationAndInit);
I_DbPool pool = (I_DbPool)tmpInfo.getObject("db.pool");
DbInfo persistentInfo = new DbInfo(pool, "replication", tmpInfo);
String name = readerInfo.get("replication.prefix", "repl_") + ".oldReplKey";
persistentInfo.put(name, "0");
Connection conn = null;
try {
conn = pool.reserve();
boolean doWarn = false; // we don't want warnings on SQL Exceptions here.
log.info("setUp: going to cleanup now ...");
this.sleepDelay = this.readerInfo.getLong("test.sleepDelay", -1L);
if (this.sleepDelay < 0L)
this.sleepDelay = this.writerInfo.getLong("test.sleepDelay", 1500L);
log.info("setUp: The sleep delay will be '" + this.sleepDelay + "' ms");
long tmp = this.readerInfo.getLong("alertScheduler.pollInterval", 10000000L);
if (this.sleepDelay <= (tmp-500L))
assertTrue("The sleep delay '" + this.sleepDelay + "' is too short since the polling interval for the dbWatcher is '" + tmp + "'", false);
dbSpecific.cleanup(conn, doWarn);
try {
pool.update("DROP TABLE " + this.tableName);
}
catch (Exception e) {
}
try {
pool.update("DROP TABLE " + this.tableName2);
}
catch (Exception e) {
}
for (int i=1; i < 5; i++) { // make sure we have deleted all triggers
try {
pool.update("DROP TRIGGER " + this.replPrefix + i);
}
catch (Exception ex) {
}
}
log.info("setUp: cleanup done, going to bootstrap now ...");
boolean force = true;
dbSpecific.bootstrap(conn, doWarn, force);
dbSpecific.shutdown();
pool.shutdown();
pool = null;
dbSpecific = null;
tmpInfo = null;
}