users@glassfish.java.net

Re: mySQL DB wiped out on every redeploy

From: <glassfish_at_javadesktop.org>
Date: Mon, 17 May 2010 00:34:59 PDT

Please note, that the same war deployed on other servers (or other servers with this war deployed) behave in normal way, i.e. if hibernate.hbm2ddl.auto is commented out as below, nothing is dropped.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">

    <persistence-unit name="immigrationDS" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/ImmigrationProcessNew</jta-data-source>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
            <!--<property name="hibernate.hbm2ddl.auto" value="create-drop"/>-->
            <!--<property name="hibernate.show_sql" value="true"/>-->
            <!--<property name="hibernate.format_sql" value="true"/>-->
            <property name="cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
            <property name="hibernate.transaction.manager_lookup_class"
                      value="org.hibernate.transaction.SunONETransactionManagerLookup"/>

        </properties>
    </persistence-unit>


</persistence>

I also have the hibernate.cfg.xml for jBPM, tables described there are dropped as well.

My guess is that this is somehow related to mySQL config, but I'm not sure what parameter to blame.
[Message sent by forum member 'dmitry_shultz']

http://forums.java.net/jive/thread.jspa?messageID=470107