@Override
public <Z, D extends Database<Z>> void synchronize(SynchronizationContext<Z, D> context) throws SQLException
{
Dialect dialect = context.getDialect();
Decoder decoder = context.getDecoder();
DumpRestoreSupport support = dialect.getDumpRestoreSupport();
if (support == null)
{
throw new SQLException(Messages.DUMP_RESTORE_UNSUPPORTED.getMessage(dialect));
}
try
{
File file = Files.createTempFile(DUMP_FILE_SUFFIX);
try
{
support.dump(context.getSourceDatabase(), decoder, file, this.dataOnly);
support.restore(context.getTargetDatabase(), decoder, file, this.dataOnly);
}
finally
{
Files.delete(file);
}