/** * Persists the given winners branch to the local database, i.e. for every database version * in the winners branch, all contained multichunks, chunks, etc. are added to the local SQL * database. * * <p>This method applies both regular database versions as well as purge database versions. */ private void persistDatabaseVersions(DatabaseBranch winnersApplyBranch, MemoryDatabase winnersDatabase) throws SQLException { // Add winners database to local database // Note: This must happen AFTER the file system stuff, because we compare the winners database with the local database! logger.log(Level.INFO, "- Adding database versions to SQL database ..."); for (DatabaseVersionHeader currentDatabaseVersionHeader : winnersApplyBranch.getAll()) { persistDatabaseVersion(winnersDatabase, currentDatabaseVersionHeader); } }