// TODO: Record total snapshot processing time?
// Simply insert into feeds table (no need for table creation) because making a snapshot presumes that the
// feeds table already exists.
private void registerSnapshot () {
        try {
            Statement statement = connection.createStatement();
            // TODO copy over feed_id and feed_version from source namespace?
            // FIXME do the following only on databases that support schemas.
            // SQLite does not support them. Is there any advantage of schemas over flat tables?
            statement.execute("create schema " + tablePrefix);
            // TODO: Record total snapshot processing time?
            // Simply insert into feeds table (no need for table creation) because making a snapshot presumes that the
            // feeds table already exists.
            PreparedStatement insertStatement = connection.prepareStatement(
                    "insert into feeds values (?, null, null, null, null, null, current_timestamp, ?)");
            insertStatement.setString(1, tablePrefix);
            insertStatement.setString(2, feedIdToSnapshot);
            insertStatement.execute();
            connection.commit();
            LOG.info("Created new snapshot namespace: {}", insertStatement);
        } catch (Exception ex) {
            LOG.error("Exception while registering snapshot namespace in feeds table: {}", ex.getMessage());
            DbUtils.closeQuietly(connection);
        }
    }
// SQLite does not support them. Is there any advantage of schemas over flat tables?
statement.execute("create schema " + tablePrefix);
// TODO: Record total snapshot processing time?
// Simply insert into feeds table (no need for table creation) because making a snapshot presumes that the
// feeds table already exists.
PreparedStatement insertStatement = connection.prepareStatement(
"insert into feeds values (?, null, null, null, null, null, current_timestamp, ?)");
private void registerSnapshot () {
try {
Statement statement = connection.createStatement();
// TODO copy over feed_id and feed_version from source namespace?
// FIXME do the following only on databases that support schemas.
// SQLite does not support them. Is there any advantage of schemas over flat tables?
statement.execute("create schema " + tablePrefix);
// TODO: Record total snapshot processing time?
// Simply insert into feeds table (no need for table creation) because making a snapshot presumes that the
// feeds table already exists.
PreparedStatement insertStatement = connection.prepareStatement(
"insert into feeds values (?, null, null, null, null, null, current_timestamp, ?)");
insertStatement.setString(1, tablePrefix);
insertStatement.setString(2, feedIdToSnapshot);
insertStatement.execute();
connection.commit();
LOG.info("Created new snapshot namespace: {}", insertStatement);
} catch (Exception ex) {
LOG.error("Exception while registering snapshot namespace in feeds table: {}", ex.getMessage());
DbUtils.closeQuietly(connection);
private void registerSnapshot () {
try {
Statement statement = connection.createStatement();
// TODO copy over feed_id and feed_version from source namespace?
// FIXME do the following only on databases that support schemas.
// SQLite does not support them. Is there any advantage of schemas over flat tables?
statement.execute("create schema " + tablePrefix);
// TODO: Record total snapshot processing time?
// Simply insert into feeds table (no need for table creation) because making a snapshot presumes that the
// feeds table already exists.
PreparedStatement insertStatement = connection.prepareStatement(
"insert into feeds values (?, null, null, null, null, null, current_timestamp, ?)");
insertStatement.setString(1, tablePrefix);
insertStatement.setString(2, feedIdToSnapshot);
insertStatement.execute();
connection.commit();
LOG.info("Created new snapshot namespace: {}", insertStatement);
} catch (Exception ex) {
LOG.error("Exception while registering snapshot namespace in feeds table: {}", ex.getMessage());
DbUtils.closeQuietly(connection);
}
}