Persistence unit is not persistent
- by etam
I need persistence unit that creates embedded database which stays persistent after closing EntityManager.
This is my PU:
<persistence-unit name="hello-jpa" transaction-type="RESOURCE_LOCAL">
<class>hello.jpa.User</class>
<properties>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:target/hsql.db"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
And it deletes data after closing application.