Persistence unit is not persistent

Posted by etam on Stack Overflow See other posts from Stack Overflow or by etam
Published on 2010-06-16T16:45:40Z Indexed on 2010/06/16 16:52 UTC
Read the original article Hit count: 306

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about jpa