[jboss-user] [EJB 3.0] - Automatic table creation

georgesberscheid do-not-reply at jboss.com
Fri Jul 6 08:19:47 EDT 2007


I'm deploying a bunch of entity beans on my JBAS 4.2.0 with my datasource pointing to a MySQL InnoDB database with no tables.
The first time I deploy the beans, everything works fine, the tables are created and the foreign keys are defined.
If I undeploy and redeploy the application, I get odd warnings and errors:

  | 11:00:14,688 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource
  | 11:00:14,898 INFO  [SettingsFactory] RDBMS: MySQL, version: 5.0.32-Debian_7etch1-log
  | 11:00:14,898 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.11 ( $Date: 2005-09-21 18:20:03 +0000 (Wed, 21 Sep 2005) $, $Revision: 4287 $ )
  | 11:00:14,918 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
  | 11:00:16,381 INFO  [DatabaseMetadata] table not found: accounts
  | 11:00:16,391 INFO  [DatabaseMetadata] table not found: customers
  | 11:00:16,441 ERROR [SchemaUpdate] Unsuccessful: create table accounts (account_id integer not null auto_increment, name varchar(255), customer_id integer, primary key (account_id)) type=InnoDB
  | 11:00:16,441 ERROR [SchemaUpdate] Table 'accounts' already exists
  | 11:00:16,461 ERROR [SchemaUpdate] Unsuccessful: create table customers (id integer not null auto_increment, name varchar(255), billing_cycle varchar(255), city varchar(255), customer varchar(255), invoice_id varchar(255), street varchar(255), vat_no varchar(255), zip varchar(255), country_id integer, primary key (id)) type=InnoDB
  | 11:00:16,461 ERROR [SchemaUpdate] Table 'customers' already exists

Does anybody know why it doesn't see that the tables are already there until the table creation fails?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061259#4061259

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061259

More information about the jboss-user mailing list