There seems to be a problem with MySQL 4.1 and JBoss 4.01 (using 
mysql-connector-java-3.1.6-bin.jar) when creating a 
CMR-many-to-many-relationship table. I have two simple CMP-beans that I try to 
connect via a relation-table. The beans both have a simple String primary key 
that is set to be VARCHAR(250) BINARY for MySQL as JBoss's standard.

This configuration gives me a SQL statement like this:
CREATE TABLE Image2Author (author_id VARCHAR(250) BINARY NOT NULL, image_id 
VARCHAR(250) BINARY NOT NULL, CONSTRAINT pk_Image2Author PRIMARY KEY 
(author_id, image_id))

and an error like this:
Error while creating table Image2Author; - nested throwable: 
(java.sql.SQLException: Specified key was too long; max key length is 1024 
bytes)

I reduced the standard String setup to a VARCHAR(190) BINARY and it also didn't 
work. However, a setup with a VARCHAR(100) BINARY worked, but that seems to be 
a rather nasty workaround.

I also played around with the MySQL setup to support UTF-8 or not, but that 
didn't make any difference.

Is there anything one could do to fix this? Any ideas?

Regards,
Alexander


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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to