I am running Roller (
http://www.rollerweblogger.org) on WebSphere Application Server 5.1.1 using MS SQL Server as the roller datasource. One of the roller tables is named rolleruser, but the Java object related to this table is just called user. SQL Server is complaining about the use of the name "user" as a table identifier in the Hibernate-generated SQL (see below); if I manually try to run the SQL generated by Hibernate and change user to usr, userX or any other word besides "user", the SQL runs fine. I don't want to change Roller source code and/or object names ... is there any Hibernate parameter that I can set to keep Hibernate from generating SQL using what appears to be a reserved word??
Hibernate version: 2.1
Hibernate properties:
hibernate.connection.datasource = java:comp/env/jdbc/rollerdb
hibernate.dialect = net.sf.hibernate.dialect.SQLServerDialect
#hibernate.dialect = net.sf.hibernate.dialect.MySQLDialect
#hibernate.dialect = net.sf.hibernate.dialect.PostgreSQLDialect
#hibernate.dialect = net.sf.hibernate.dialect.HSQLDialect
#hibernate.dialect = org.roller.persistence.hibernate.HSQLDialect
hibernate.show_sql=true
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
[8/11/04 9:35:31:151 PDT] 60c3a775 WebGroup I SRVE0180I: [Roller Weblogger] [/blogs] [Servlet.LOG]: Application 1860740989 requests WikiEngine.
[8/11/04 9:35:31:167 PDT] 60c3a775 WebGroup I SRVE0180I: [Roller Weblogger] [/blogs] [Servlet.LOG]: Application 1860740989 requests WikiEngine.
[8/11/04 9:35:31:167 PDT] 60c3a775 WebGroup I SRVE0180I: [Roller Weblogger] [/blogs] [Servlet.LOG]: Application 1860740989 requests WikiEngine.
[8/11/04 9:35:31:667 PDT] 60c3a775 PropertyMessa I org.apache.struts.util.PropertyMessageResources Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
[8/11/04 9:36:02:371 PDT] 2129e775 SystemOut O
Hibernate: select this.id as id3_, this.name as name3_, this.description as descript3_3_, this.userid as userid3_, this.defaultpageid as defaultp5_3_, this.weblogdayid as weblogda6_3_, this.enablebloggerapi as enablebl7_3_, this.bloggercatid as bloggerc8_3_, this.defaultcatid as defaultc9_3_, this.editorpage as editorpage3_, this.ignorewords as ignorew11_3_, this.allowcomments as allowco12_3_, this.emailcomments as emailco13_3_, this.emailfromaddress as emailfr14_3_, this.editortheme as editort15_3_, this.locale as locale3_, this.timezone as timezone3_, this.defaultplugins as default18_3_, this.isenabled as isenabled3_, user.id as id0_, user.username as username0_, user.passphrase as passphrase0_, user.fullname as fullname0_, user.emailaddress as emailadd5_0_, user.datecreated as datecrea6_0_, weblogcate2_.id as id1_, weblogcate2_.name as name1_, weblogcate2_.description as descript3_1_, weblogcate2_.image as image1_, weblogcate2_.websiteid as websiteid1_, weblogcate3_.id as id2_, weblogcate3_.name as name2_, weblogcate3_.description as descript3_2_, weblogcate3_.image as image2_, weblogcate3_.websiteid as websiteid2_ from website this inner join rolleruser user on this.userid=user.id left outer join weblogcategory weblogcate2_ on this.bloggercatid=weblogcate2_.id left outer join weblogcategory weblogcate3_ on this.defaultcatid=weblogcate3_.id where (user.username=? and this.isenabled=?)
[8/11/04 9:36:02:558 PDT] 2129e775 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: 170, SQLState: HY000
[8/11/04 9:36:02:574 PDT] 2129e775 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near '.'.
[8/11/04 9:36:02:574 PDT] 2129e775 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: 8180, SQLState: HY000
[8/11/04 9:36:02:574 PDT] 2129e775 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][SQLServer JDBC Driver][SQLServer]Statement(s) could not be prepared.
[8/11/04 9:36:02:590 PDT] 2129e775 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: 170, SQLState: HY000
[8/11/04 9:36:02:590 PDT] 2129e775 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near '.'.
[8/11/04 9:36:02:590 PDT] 2129e775 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: 8180, SQLState: HY000
[8/11/04 9:36:02:590 PDT] 2129e775 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][SQLServer JDBC Driver][SQLServer]Statement(s) could not be prepared.
[8/11/04 9:36:02:590 PDT] 2129e775 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter SQLException occurred
[8/11/04 9:36:02:605 PDT] 2129e775 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged java.sql.SQLException: [IBM][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near '.'.
at com.ibm.websphere.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.ibm.websphere.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.ibm.websphere.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.ibm.websphere.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.ibm.websphere.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
at com.ibm.websphere.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.ibm.websphere.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.ibm.websphere.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.ibm.websphere.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.ibm.websphere.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
at com.ibm.websphere.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.ibm.websphere.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.ibm.websphere.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at com.ibm.websphere.jdbcx.base.BasePreparedStatementWrapper.executeQuery(Unknown Source)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:426)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:955)
at net.sf.hibernate.loader.Loader.list(Loader.java:946)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:121)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3604)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
at org.roller.business.hibernate.HibernateUserManagerImpl.getWebsite(HibernateUserManagerImpl.java:111)
at org.roller.business.UserManagerImpl.getWebsite(UserManagerImpl.java:79)
at org.roller.presentation.RollerRequest.parseRequestParams(RollerRequest.java:278)
at org.roller.presentation.RollerRequest.init(RollerRequest.java:151)
at org.roller.presentation.RollerRequest.<init>(RollerRequest.java:108)
at org.roller.presentation.RollerRequest.getRollerRequest(RollerRequest.java:347)
at org.roller.presentation.filters.RequestFilter.doFilter(RequestFilter.java:109)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at org.roller.presentation.filters.CloseSessionFilter.doFilter(CloseSessionFilter.java:59)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Name and version of the database you are using: MS SQL Server
Debug level Hibernate log excerpt: