Title:
Debug information for ORM DDL Update Exceptions occluded by error displayed on screen, even w/robust exceptions enabled
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/CannotReproduce
Reporter/Name(from Bugbase): Adam Tuttle / Adam Tuttle (Adam Tuttle)
Created: 01/02/2014
Components: ORM Support
Versions: 10.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: Final /
Priority/Frequency: Minor / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 0
I made an ORM change and tried to ormReload(). This was the resulting error message:
> Error in executing the DDL.
>
> Cannot add or update a child row: a foreign key constraint fails (`cased2`.`#sql-504_3f`, CONSTRAINT `FK3737353BFDC35CA7` FOREIGN KEY (`sessionID`) REFERENCES `session` (`sessionID`))
Enabling robust exception information does not improve the messaging AT ALL, except that the Java Stack Trace is shown.
Turning up the Hibernate log level to log DDL changes does show useful information:
> HIBERNATE DEBUG - alter table Document add index FK3737353BFDC35CA7 (sessionID), add constraint FK3737353BFDC35CA7 foreign key (sessionID) references `Session` (sessionID)
Clearly it's trying to resolve data that exists in the database that violates a constraint that's being created, so constraint creation fails.
The failure here is to report useful information in the exception message. I originally spent some time digging into my database looking for a constraint with id "FK3737353BFDC35CA7" but obviously couldn't find it because it couldn't be created. A wild goose chase!
I recall you have asked us to let you know how ORM Error Reporting could be improved, so here you go! Bubble these error messages up to the surface when robust exception information is enabled! Having to go tweak logging settings and then dig around in logs is NOT germane to debugging CFML.
I'm logging this against CF10 since that's the latest, but obviously it also affects CF9.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3688668
External Customer Info:
External Company:
External Customer Name: Adam Tuttle
External Customer Email:
External Test Config: My Hardware and Environment details: N/A
Attachments:
Comments: