Unless error message shows limit 1024, limit is 320 characters per key - so for each part af this key you can use only 160 charactes.
That was a typo, the error message shows limit of 1024.
The to be created table would have a primkey of two varchar-fields. A varchar-field is set to 250 in the JBoss default configuration, even if I assume two-byte characters, that would only sum up to 500 - not even close to 1024.
Nevertheless - I wonder what would be the right way to solve this issue. I don't think the right way would be to reduce the varchar standard to be 100 inside the JBoss standard-setup, as that would affect every field inside the whole application. And what would I have to do, if I had to create primkeys or indexes consisting of even more fields? That would make me end-up with even smaller varchar-fields.
What table type are you using with MySQL? I think it is MyISAM tables that impose this restriction - try setting the default table type to InnoDB tables which are required for transaction support anyway.
You're right, I use the JBoss standard-settings and those don't define any table-type, that gives MyISAM on my MySQL-server. I wonder what would be the best way to set this up for InnoDB?
Are you using a my.ini or my.cnf file for MySQL?
If you add the following line to the file in the [mysqld] section.
Any newly created tables should be InnoDB.
You may need to restart MySQL and if you are running it as a service you may need to reregister it to pick up the new settings.
Well, I know that would work, but I can't do it - it would affect all dbs created by MySQL. Isn't there a JBoss-way of doing it?