I'm using openLCA core maven module to make impact calculations.
My problem is: I want to create the MatrixCache once, because it is long (30 seconds). This MatrixCache has a IDatabase property. I want to close the connection to this database when the cache is created, and get a new connection when I want to run the calculations :
IDatabase db = new DerbyDatabase(new File(path));
MatrixCache mCache = MatrixCache.createEager(db);
// Do other stuff
// Run calculations
ProductSystem system = ...
CalculationSetup setup = ...
SystemCalculator calc = new SystemCalculator(mCache, new DenseSolver());
SimpleResult r = calc.calculateContributions(setup);
This won't work because the database was closed. So how to "re-open" the MatrixCache database before using it ?
Thank you very much in advance,