Geoweaver
Geoweaver copied to clipboard
Support for DEFRAG on H2
H2 currently does not automatically DEGRAF / COMPACT the database on quit. This creates huge file sizes. We need to explore further to see if we can make this run automatically
the command to run compact is
shutdown compact
but I dont think CRON is the solution here since the command shutsdown the db performing compact operation so the db connection will most probably be disconnected We shell / bash script to stop the geoweaver server and perform the operation and restart the server would be the best, we can do this at time when we expect no traffic like 3 AM
Currently he is how we perform defrag manually on our remote instance:
$ java -cp h2-1.3.176.jar org.h2.tools.Shell -url "jdbc:h2:file:/home/chetana/h2/gw.mv.db" -user "geoweaver" -password "<YOUR_PASSWORD>"
$ compact shutdown;
This operation should be performed automatically. A better alternative is by using SQLite which needs testing to make sure it is a drop-in replacement for H2.
try sqlite as our primary db https://github.com/xerial/sqlite-jdbc