I've checked out JBOSS 3.0 CVS (snapshot of 12/16), compiled and run it using mySQL as datasource without error. But when my CMP20 Entity Bean test code is deployed, the following error was observed in server.log:
2001-12-17 20:36:41,229 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Parent] Executing SQL: CREATE TABLE Parent (parentId INTEGER, parentName VARCHAR(255) BINARY, CONSTRAINT pkParent PRIMARY KEY (parentId)) 2001-12-17 20:36:41,349 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Parent] Could not create table Parent java.sql.SQLException: General error: All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550) at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815) at org.gjt.mm.mysql.Statement.executeUpdate(Statement.java:227) at org.gjt.mm.mysql.jdbc2.Statement.executeUpdate(Statement.java:97) at org.jboss.resource.adapter.jdbc.local.StatementInPool.executeUpdate(StatementInPool.java:736) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:133) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:63) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:231) at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:174) at org.jboss.ejb.EntityContainer.start(EntityContainer.java:335) at org.jboss.ejb.Application.start(Application.java:219) at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:376) at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:300) at java.lang.reflect.Method.invoke(Native Method) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:463) at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:435) at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:202) at java.lang.reflect.Method.invoke(Native Method) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:683) at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:326) at java.lang.Thread.run(Thread.java:484) The same test code was running fine on the JBOSS server CVS checked out a month ago (11/16), with the CREATE TABLE sql script as followed: [2001-12-17 22:30:52,441,CMP,DEBUG] Start command executing: CREATE TABLE Parent (parentId INTEGER, parentName VARCHAR(255) BINARY) Obviously mySQL doesn't like the primary key 'CONSTRAINT' clause. My suggestion would be to append 'NOT NULL' after primary key field declaration while calling SQLUtil.getCreateTableColumnsClause() in JDBCStartCommand.getEntityCreateTableSQL(). Let me know if I'm totally wrong or missing something big here. --- Jeffrey ______________________________________________________________________ View this jboss-dev thread in the online forums: http://jboss.org/forums/thread.jsp?forum=66&thread=5835 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
