tracker issue : CF-3036884

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

Bug 73856:[ORM] There should be a note on documentation about reserved words in table names

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): João Fernandes / João Fernandes (Joao Fernandes)

Created: 11/28/2008

Components: ORM Support

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 / 220733

Priority/Frequency: Major / Unknown

Locale/System: English / Platforms All

Vote Count: 0

Problem:

[ORM] There should be a note on documentation about reserved words in table names. It should mention (eg MSSQL) if we have a table User it should be used in the CFC table="[User]".


Method:

1.  Copy the files in the directory \\blrfs04.macromedia.com\Builds\ColdFusion\bugs\73856 to a folder under webroot.
2.  Run a.cfm

Got: Table User gets created but Error is thrown when executing ORMExecuteQuery as the word "User" is a reserved word in Microsoft SQL Server.

Expected: Should discuss.
Result:

 Error while executing the hibernate query.
org.hibernate.exception.GenericJDBCException: could not execute query
 
The error occurred in C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\C1.cfc: line 4
Called from C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\a.cfm: line 1
Called from C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\C1.cfc: line 4
Called from C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\a.cfm: line 1

2 : 	<cffunction name="getEmployees" returntype="any">
3 : 		<cfset cname="USA">
4 :         <cfset empObj = ORMExecuteQuery("from employees where Country=:name", {name=cname})>
5 :         <cfreturn empObj>
6 :     </cffunction>

Resources:

    * Check the ColdFusion documentation to verify that you are using the correct syntax.
    * Search the Knowledge Base to find a solution to your problem.

Browser   	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
Remote Address   	127.0.0.1
Referrer   	http://localhost:8500/ormbug/
Date/Time   	01-Dec-08 03:24 PM
Stack Trace
at cfC12ecfc879950501$funcGETEMPLOYEES.runFunction(C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\C1.cfc:4) at cfa2ecfm2109642684.runPage(C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\a.cfm:1) at cfC12ecfc879950501$funcGETEMPLOYEES.runFunction(C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\C1.cfc:4) at cfa2ecfm2109642684.runPage(C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\a.cfm:1)

org.hibernate.exception.GenericJDBCException: could not execute query
	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	at org.hibernate.loader.Loader.doList(Loader.java:2216)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
	at org.hibernate.loader.Loader.list(Loader.java:2099)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
	at coldfusion.orm.hibernate.HibernatePersistenceManager._executeHQL(HibernatePersistenceManager.java:479)
	at coldfusion.orm.hibernate.HibernatePersistenceManager.executeHQL(HibernatePersistenceManager.java:431)
	at coldfusion.orm.hibernate.HibernatePersistenceManager.executeQueryWithNamedParams(HibernatePersistenceManager.java:424)
	at coldfusion.orm.ORMUtils.executeQuery(ORMUtils.java:238)
	at coldfusion.orm.ORMUtils.executeQuery(ORMUtils.java:221)
	at coldfusion.runtime.CFPage.ORMExecuteQuery(CFPage.java:7261)
	at cfC12ecfc879950501$funcGETEMPLOYEES.runFunction(C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\C1.cfc:4)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:424)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:357)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:320)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:274)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:194)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:507)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:324)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2318)
	at cfa2ecfm2109642684.runPage(C:\dev\ColdFusion\cf_main\cfusion\wwwroot\ormbug\a.cfm:1)
	at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:214)
	at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
	at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:289)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
	at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
	at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)
	at coldfusion.CfmServlet.service(CfmServlet.java:177)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
	at jrun.servlet.FilterChain.service(FilterChain.java:101)
	at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
	at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
	at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
	at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
	at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
	at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
	at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
	at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
	at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'User'.
	at macromedia.jdbc.base.BaseExceptions.createException(Unknown Source)
	at macromedia.jdbc.base.BaseExceptions.getException(Unknown Source)
	at macromedia.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
	at macromedia.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
	at macromedia.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
	at macromedia.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
	at macromedia.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
	at macromedia.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
	at macromedia.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
	at macromedia.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
	at macromedia.jdbc.base.BaseStatement.commonExecute(Unknown Source)
	at macromedia.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
	at macromedia.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
	at macromedia.jdbc.base.BasePreparedStatementPoolable.executeQuery(Unknown Source)
	at coldfusion.server.j2ee.sql.JRunPreparedStatement.executeQuery(JRunPreparedStatement.java:74)
	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
	at org.hibernate.loader.Loader.doQuery(Loader.java:674)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
	at org.hibernate.loader.Loader.doList(Loader.java:2213)
	... 54 more

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3036884

External Customer Info:
External Company:  
External Customer Name: João Fernandes
External Customer Email: 4E9A42C244586146992015D5
External Test Config: 11/28/2008

Attachments:

Comments: