The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Hello,

I am planning on buying your book I think I am going to need it.

I have a very quick question to ask you first.

I am using JBoss AS 7 with JPA 2.0 and mapping to a MySQL database via mysql-connector-java-5.1.27-bin.jar

My problem is this, while the module is deployed and JBoss is running, records appear in the database fine. The moment I stop JBoss or undeploy the module the records dissappear. Nothing I seem to do makes any difference.

How is hibernate supposed to be used so that the records are not automatically deleted should JBoss stop?

I've tried the following options:

<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>

It doesn't seem to make any difference.

Is there a tutorial I can see that will show me how to preserve the records in the database?

Thanks,

Perry