Hi all
I'm having trouble with permanent data persistence. Inside a process I am able to successfully CRUD entities into my hsql DB. The data is there and I have access to it by finder methods (checked). But once the application is shut down there is no data written to the DB file (checked with Eclipse Database Explorer). HSQL is configured correctly, table type is cached.
Hibernate Version 3.2 with Annotaions and EntityManager.
persistence.xml
Code:
<persistence-unit name="myPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>my.class</class>
<properties>
<property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver" />
<property name="hibernate.connection.url"
value="jdbc:hsqldb:file:/db/mydb;shutdown=true" />
<property name="hibernate.connection.username" value="sa" />
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
</properties>
</persistence-unit>
I'm using a MyEclipse generated EntityManagerHelper class and this is the persist call:
Code:
EntityManagerHelper.beginTransaction();
EntityManagerHelper.getEntityManager().persist(entity);
EntityManagerHelper.commit();
What am I doing wrong? I'm stuck :(
Thanks very much in advance!
Simon