1 Reply Latest reply on Apr 14, 2008 8:03 PM by john hedden

    Database Initialization

    john hedden Newbie

      Everything runs fine locally but when I deploy my .ear and ds.xml I get the following error on startup:

      MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails

      The table schema is created from the entity annotations and in my persistence.xml I have:

      <persistence-unit name="ooord">
               <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="jboss.entity.manager.factory.jndi.name" value="java:/ooordEntityManagerFactory"/>

      Why would this work locally but not when deployed?  Same user, same password and also GRANT ALL.

      Im stumped.