tracker issue : CF-4203835

select a category, or use search below
(searches all categories and all time range)
Title:

Table names that clash with reserved words no longer escaped properly

| View in Tracker

Status/Resolution/Reason: To Test//UserError

Reporter/Name(from Bugbase): Mike Hodgson / ()

Created: 12/19/2018

Components: ORM Support

Versions: 2018

Failure Type: Crash

Found In Build/Fixed In Build: CF 2018 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Problem Description:

If you name an ORM entity the same as a reserved word in SQL Server, a crash occurs when Hibernate attempts to update the table (creation is OK). This is even with escaping the table name in the table="" attribute of the CFC.

Steps to Reproduce:

Create a persisted CFC with the entityname="Group"
Reload application
Add a new property
Reload application again

Actual Result:

Error regarding incorrect syntax near the keyword 'Group'

Expected Result:

Table created

Any Workarounds:

Rename table or entities

Attachments:

Comments:

As per my investigation, i found that the query generated by Hibernate framework in this case is correct, its just that the JDBC drivers doesn't allow executing these kind of queries. the following query is generated by hibernate *alter table ORM_Northwind_Modify.dbo.Group add Misc1 varchar(255) default 'Any Default Value'* I even tried with MSSQL jdbc driver and there also it restricts these type of queries. So its not a problem with Hibernate but the underlying jdbc drivers which doesn't allow these queries in alter table syntax.
Comment by Ashudeep S.
31771 | December 21, 2018 12:06:13 PM GMT