Skip to content

Upgrade H2 1.x to 2.x

Jody Garnett edited this page Jan 26, 2024 · 3 revisions

GeoServer enjoys using h2 as an easy to use pure java database usable as a spatial index: NetCDF, imagemosiac, gwc diskquota, geofence, etc..

However we are using H2 1.x and their are challenges to overcome when upgrading to H2 2.x:

  • H2 2.x uses a different binary layout on disk
  • No seamless upgrade or conversion is available
  • The built-in approach is to download a jar from maven at runtime using a separate classloader to write out the SQL, and then read the SQL back into the H2 database
  • We use a fork of hatbox (jodygarnett/hatbox) to JTS geometry with and provide a spatial index

Consider:

  • h2gis offers H2 2.x database with spatial index and includes a GeoTools DataStore (but it is LGPL v3.0)
  • GeoFence (uses H2 and hibernate / hibernate spatial)
  • GWC DiskQuota
  • NetCDF indexes (one per NetCDF file used by GeoServer)

This activity will require careful coordination across a number of projects.

Removing gt-h2-jdbc dependency

core modules

  • removed H2 from core modules, replaced by HSQLDB.

test dependencies:

  • main
  • wms
  • wfs
  • web/core
  • restconfig-wfs
  • restconfig-wcs
  • restconfig

extensions:

  • importer
  • h2

test dependencies:

  • wps-core, wps-jdbc

community modules

  • ogcapi-image, ogcapi-changeset

community module test dependencies:

  • backup-restore
  • cog
  • importer-jdbc
  • web-osgeo, osgeo-service, osgeo-rest, osgeo-core
Clone this wiki locally