My program will be reading GeoLite2-Country.mmdb from the location where automatic update has been set, So my question is Will automatic update work and update the file at the same time when my program is reading GeoLite2-Country.mmdb ??
@PostConstruct
public void init()
{
try
{
LOG.info("Trying to load maxmind GeoLite2-Country database...");
final Resource resource = resourceLoader.getResource(FILE + Config.getParameter(DATABASE_PATH));
final File db = resource.getFile();
reader = new DatabaseReader.Builder(db).build();
LOG.info("Maxmind database was loaded successfully.");
}
catch (IOException | NullPointerException e)
{
LOG.error("Error maxmind database reader cound not be initialized. ", e);
}
}
Yes, that should be fine on unix-like systems. The new file is moved over the old file and any process using the old file should be able to continue using it.
My program will be reading GeoLite2-Country.mmdb from the location where automatic update has been set, So my question is Will automatic update work and update the file at the same time when my program is reading GeoLite2-Country.mmdb ??