From: <leg...@at...> - 2004-08-13 08:31:06
|
The following comment has been added to this issue: Author: CVS Notification Service Created: Fri, 13 Aug 2004 3:54 AM Body: CVS COMMIT LOG: SUBJECT: [Hibernate-commits] Hibernate3/src/org/hibernate/tool/hbm2ddl DatabaseMetadata.java,1.3,1.4 fixed problems with SchemaUpdate (after all this time) HB-478, HB-409 --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HB-478?page=comments#action_14106 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HB-478 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-478 Summary: Foreign Key constraints duplicated with SchemaUpdate Type: Bug Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Fix Fors: 3.0 alpha 2.1.7 Versions: 2.0.3 Assignee: Christian Bauer Reporter: Gerjon de Vries Created: Tue, 18 Nov 2003 10:48 AM Updated: Fri, 13 Aug 2004 3:54 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 |