What is the "default datasource" in the Payara Starter example of Payara Micro Database Authentication?

Your observation is correct regarding Payara Micro’s configuration of the H2 database. Payara Micro uses an embedded H2 database, which persists data to disk by default.

Here is the relevant configuration from domain.xml for both Payara Server and Payara Micro:

Payara Server domain.xml:

<jdbc-resource pool-name="H2Pool" jndi-name="jdbc/__default" object-type="system-all" />
<jdbc-connection-pool is-isolation-level-guaranteed="false" name="H2Pool" datasource-classname="org.h2.jdbcx.JdbcDataSource" res-type="javax.sql.DataSource">
  <property name="URL" value="jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/embedded_default;AUTO_SERVER=TRUE" />
</jdbc-connection-pool>

Payara Micro domain.xml:

<jdbc-resource pool-name="H2Pool" jndi-name="jdbc/__default" object-type="system-all" />
<jdbc-connection-pool is-isolation-level-guaranteed="false" name="H2Pool" datasource-classname="org.h2.jdbcx.JdbcDataSource" res-type="javax.sql.DataSource">
  <property name="URL" value="jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/embedded_default;AUTO_SERVER=TRUE" />
</jdbc-connection-pool>
1 Like