Oh! Sorry! Sorry, for the second problem :) The log is right. 255 + 255 = 510 :)) making fields' sizes sum less then 500 solves the second problem.
alex > -----Original Message----- > From: Alex Loubyansky [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 04, 2002 3:33 PM > To: Jboss-User (E-mail) > Subject: many-to-many in JBoss-3.0.0beta2 > > Hello everybody! > > I wrote to entity beans DocumentEntity and SectionEntity > with many-to-many relationship. And I met two problems. > > 1. I had primary keys in both named 'id'. I.e. two table > DocumentEntity and SectionEntity have primary keys with the > same name. During deployment I got the exception saying: > 2002-03-04 14:53:44,407 DEBUG > [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DocumentEntit > y] Executing SQL: CREATE TABLE > DocumentEntity_sectionEntities_SectionEntity_documentEntities > (id VARCHAR(255) BINARY NOT NULL, id VARCHAR(255) BINARY NOT > NULL, CONSTRAINT > pk_DocumentEntity_sectionEntities_SectionEntity_documentEntiti > es PRIMARY KEY (id, id)) > 2002-03-04 14:53:44,407 DEBUG > [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DocumentEntit > y] Could not create table > DocumentEntity_sectionEntities_SectionEntity_documentEntities > 2002-03-04 14:53:44,417 ERROR [org.jboss.ejb.EntityContainer] > Exception in service lifecyle operation: start > org.jboss.deployment.DeploymentException: Error while > creating table; - nested throwable is: java.sql.SQLException: > Invalid argument value: Duplicate column name 'id' > java.sql.SQLException: Invalid argument value: Duplicate > column name 'id' > > Of course, it's easy to walk around it by renaming primary > key fields. In my case it's not a problem at all, though it > would be better to correct it, I think. > > 2. But now a real problem. When I changed the fields' names > to documentId and sectionId accordingly I got the following > log with exception: > 2002-03-04 15:14:36,697 DEBUG > [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DocumentEntit > y] Executing SQL: CREATE TABLE > DocumentEntity_sectionEntities_SectionEntity_documentEntities > (documentId VARCHAR(255) BINARY NOT NULL, sectionId > VARCHAR(255) BINARY NOT NULL, CONSTRAINT > pk_DocumentEntity_sectionEntities_SectionEntity_documentEntiti > es PRIMARY KEY (documentId, sectionId)) > 2002-03-04 15:14:36,707 DEBUG > [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DocumentEntit > y] Could not create table > DocumentEntity_sectionEntities_SectionEntity_documentEntities > 2002-03-04 15:14:36,717 ERROR [org.jboss.ejb.EntityContainer] > Exception in service lifecyle operation: start > org.jboss.deployment.DeploymentException: Error while > creating table; - nested throwable is: java.sql.SQLException: > Invalid argument value: Specified key was too long. Max key > length is 500 > java.sql.SQLException: Invalid argument value: Specified key > was too long. Max key length is 500 > > Could someone explain how to solve it? Thank you in advance! > > My environment: JBoss-3.0.0beta2, MySQL, Windows2000 > > alex > _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user