0 Replies Latest reply on Dec 1, 2005 3:03 AM by rcasha

    MySQL / EJB3 problem when specifying schema

    rcasha

      I'm using entity EJB3s with JBoss4.0.3 and MySQL, and I'm specifying the schema in the EJBs via @Table(schema="xxx").

      Although the app works fine, each time I deploy it again or restart jboss it tries to check whether the tables exist, but it uses different names for the tables and does not find them, then tries to re-create them and finds they already exist and gives errors.

      This seems to be caused because the tables are created as SCHEMA_TABLENAME under mysql, but when jboss tries to check whether the tables exist, it searches for them as TABLENAME.

      This rarely causes problems but I have the hibernate.hbm2ddl.auto property set to update, and if I change an EJB property it doesn't find the table but doesn't manage to create it anew (since it already exists) so essentially it doesn't update the table definition.