H2 database configuration

In the base configuration, Guidewire provides several default database configurations for the H2 database in file database-config.xml:
  • h2
  • h2mem
In Studio, PolicyCenter uses the in-memory version of the H2 database (h2mem) while running the server in test mode. Thus, you can start the application server from Studio using either of the following commands from the Studio Run menu:
  • Server
  • TestServer
If you choose the Server command, PolicyCenter starts the server with no named environment, which maps to the h2 database configuration in file database-config.xml:
<database name="PolicyCenterDatabase" dbtype="h2">
  <dbcp-connection-pool jdbc-url="jdbc:h2:file:/tmp/guidewire/pc"/>
  <upgrade defer-create-nonessential-indexes="false"/>
</database>
If you choose the TestServer command, PolicyCenter starts the server with the h2mem environment, which maps to the h2mem database configuration in file database-config.xml:
<database name="PolicyCenterDatabase" dbtype="h2" env="h2mem">
  <dbcp-connection-pool jdbc-url="jdbc:h2:mem:/tmp/guidewire/pc"/>
  <upgrade defer-create-nonessential-indexes="false"/>
</database>

The h2mem configuration starts the application server, which then stores the H2 database in memory. The server then discards the H2 database in memory after you shutdown the server. Thus, the server rebuilds the H2 database every time you start the H2 server in H2mem mode.