Skip to content

Demonstration of the embedded H2 database in Payara 5

Notifications You must be signed in to change notification settings

vasouv/jpa-h2-payara

Repository files navigation

JPA H2 with Payara

Payara 5 has H2 for embedded database instead of Derby. The connection pool is already set up in the server, so if you deploy an app that links to that connection pool you should be good to go.

persistence.xml

<persistence-unit name="h2PU" transaction-type="JTA">
        <jta-data-source>jdbc/__default</jta-data-source>
        <properties>
            <property name="javax.persistence.schema-generation.database.action" value="drop-and-create" />
        </properties>
    </persistence-unit>

Startup bean

For JAX-RS, the startup bean can be annotated @Startup + @Singleton. For JSF though, the startup bean must be annotated @ApplicationScoped + @Eager (from Omnifaces).

About

Demonstration of the embedded H2 database in Payara 5

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages