users@glassfish.java.net

Re: mySQL DB wiped out on every redeploy

From: Steven Siebert <smsiebe_at_gmail.com>
Date: Mon, 17 May 2010 06:57:04 -0400

hibernate.hbm2ddl.auto was something I was certainly looking for in the
persistence.xml file...interesting that it is commented out.

Is there any chance that you may be deploying an old version of the jar -
where those lines are not commented out? (I know, this is a stretch, since
you're deploying it on other servers)

The other app servers you deploy this to, and it doesn't drop create - are
they glassfish? What version? What version of hibernate are you using?

I'm disinclined to say the problem may be with MySQL config..because MySQL
doesn't care/know anything about the DDL generation files. I believe more
likely it has something to do with the JPA library (hibernate) or perhaps
the way GlassFish hands off config values to Hibernate...although I believe
this is decoupled - the only the GF "knows" about is data source info (ie
connection info, pooling info, etc) - and that is defined in
sun-resources.xml.

Regards,

Steve

On Mon, May 17, 2010 at 3:34 AM, <glassfish_at_javadesktop.org> wrote:

> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>