users@glassfish.java.net

Re: restart-domain executes eclipselink.ddl-generation setting

From: Bobby Bissett <bbissett_at_gmail.com>
Date: Mon, 11 Feb 2013 15:44:05 -0500

On Mon, Feb 11, 2013 at 11:28 AM, Bobby Bissett <bbissett_at_gmail.com> wrote:
>
> [...] Will verify that it happens again and will file an
> issue if so.

Yep, it happens over and over. I deploy my app with the
persistence.xml pasted below, register an initial user with my app,
and verify that app sees the user and I see the user in the db when I
query the database directly. Then I run "asadmin restart-domain" and
all of my tables are dropped. Reloading the app shows our "no users
are registered" page and viewing the data in the db directly shows all
the tables are empty.

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
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_2_0.xsd">
  <persistence-unit name="NameHerePU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
      <non-jta-data-source>jdbc/namehere</non-jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="eclipselink.target-database" value="PostgreSQL"/>
      <property name="eclipselink.show_sql" value="true"/>
      <property name="eclipselink.ddl-generation.output-mode" value="database"/>
      <property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/>
    </properties>
  </persistence-unit>
</persistence>

Before I file an issue, do you see anything wrong with the
persistence.xml above? Also, under what category should this be filed.
I dunno if it's JPA issue since the server startup has to be calling
JPA and giving it some info telling it to do this.

Thanks,
Bobby