src/main/java/com/conveyal/gtfs/loader/JdbcGtfsSnapshotter.java
private void registerSnapshot () {
        try {
            // We cannot simply insert into the feeds table because if we are creating an empty snapshot (to create/edit
            // a GTFS feed from scratch), the feed registry table will not exist.
            // TODO copy over feed_id and feed_version from source namespace?
            // TODO: Record total snapshot processing time?
            createFeedRegistryIfNotExists(connection);
            createSchema(connection, tablePrefix);
            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);
            DbUtils.closeQuietly(connection);
        }
    }
private void registerSnapshot () {
        try {
            // We cannot simply insert into the feeds table because if we are creating an empty snapshot (to create/edit
            // a GTFS feed from scratch), the feed registry table will not exist.
            // TODO copy over feed_id and feed_version from source namespace?
            // TODO: Record total snapshot processing time?
            createFeedRegistryIfNotExists(connection);
            createSchema(connection, tablePrefix);
            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);
            DbUtils.closeQuietly(connection);
        }
    }
private void registerSnapshot ( ) { try { // We cannot simply insert into the feeds table because if we are creating an empty snapshot (to create/edit // a GTFS feed from scratch), the feed registry table will not exist. // TODO copy over feed_id and feed_version from source namespace? // TODO: Record total snapshot processing time? createFeedRegistryIfNotExists ( connection ) ; createSchema ( connection , tablePrefix ) ; 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 ) ; DbUtils . closeQuietly ( connection ) ; } }
Add a line to the list of loaded feeds to record the snapshot and which feed the snapshot replicates.
Add a line to the list of loaded feeds to record the snapshot and which feed the snapshot replicates .