jasmineRepo / JAS-mine-core

JAS-mine maintains and develops the JAS simulation platform, a discrete-event tool-kit for agent-based and dynamic microsimulation modelling. This repository contains the core libraries. See www.jas-mine.net for more details.
2 stars 5 forks source link

Current setup reverts to base input database after first copy? #36

Closed andrewbaxter439 closed 9 months ago

andrewbaxter439 commented 1 year ago

The following lines seem to:

  1. start a multirun by copying input folder - including input.mv.db - to a unique folder output/yyyymmdd/input
  2. create populations from the copy database with no problems
  3. after first run, reset DatabaseUtils.databaseInputUrl to be the root input.mv.db
  4. leave the output/yyyymmdd/input/input.mv.db untouched for the rest of the run?

https://github.com/jasmineRepo/JAS-mine-core/blob/6350178f69953577c97a10f451a7661e802efda1/microsim-core/src/main/java/microsim/data/ExperimentManager.java#L159-L160

https://github.com/jasmineRepo/JAS-mine-core/blob/6350178f69953577c97a10f451a7661e802efda1/microsim-core/src/main/java/microsim/data/ExperimentManager.java#L177-L180

The odd thing is, commenting out this line and running again produces, only in the second run of the multirun, the following error:

ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Column "P1_0.COVIDMODULEBASELINEPAYXT5" not found; SQL statement: select ... p1_0.covidModuleBaselinePayXt5 ... from Person p1_0

I would expect the copied input database to be the stable, correct database for all subsequent runs?

andrewbaxter439 commented 1 year ago

Update from experimentation:

I would presume that the key to making this work (runs n+1 onwards reading the copied input.mv.db) would be to find all instances of creating a connection with this database and ensuring that they're all closed or run as server mode?

andrewbaxter439 commented 9 months ago

Resolved in #41