Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-478
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-478
Summary: Foreign Key constraints duplicated with SchemaUpdate
Type: Bug
Status: Unassigned
Priority: Major
Project: Hibernate2
Versions:
2.0.3
Assignee:
Reporter: Gerjon de Vries
Created: Tue, 18 Nov 2003 10:48 AM
Updated: Tue, 18 Nov 2003 10:48 AM
Environment: MySql 4.0.16-Max, mysql-connector-java-3.0.9-stable-bin, InnoDB tables, Linux (SuSe 9.0).
Description:
When using SchemaUpdate to create/alter table definitions, each consecutive use of "SchemaUpdate(configuration).execute(true)" will regenerate all foreign key constraint commands (e.g. "ALTER TABLE X add index(fromId), add constraint FK2065BD77CB5B07 foreign key (fromId) references Y(id)"). Effectively you get duplicates for each key, which might degrade performance, and after some time cause errors, since MySql allows a limited number of FK's.
It seems to me that this is caused by a mismatch of the constraint names in net.sf.hibernate.mapping.Table and net.sf.tool.hbm2ddl.TableMetaData, but I'm not 100% sure. The "ALTER TABLE ..." is generated in Configuration.java:462.
Note that I'm using InnoDB tables (for the transaction support). Also note that the problem will only reproduce with mysql-connector-java-3.0.8-stable-bin (or newer), since older versions have a bug with requesting foreign key information on InnoDB tables.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|