Can no longer deploy after column was renamed.

Topics related to the LSPS Engine and the management of running processes.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
cbmeeks
 
Posts: 59
Joined: Wed Aug 07, 2013 11:28 pm

Can no longer deploy after column was renamed.

Wed May 14, 2014 11:15 pm

A while back, we had a model called "Tickets" that has a one-to-one relationship with another model called "EventDetails".

The relationship was originally setup as:

Foreign Key Name: TICKET_EVENTDETAIL
PK Table: EVENTDETAIL
PK Column: ID
FK Table: TICKET
FK Column: EventDetail_ID

Notice how the foreign key column USED to be spelled "EventDetail_ID" (mixed case).

Later, we renamed that column to an uppercase version ("EVENTDETAIL_ID") to match all of the other foreign keys in our system. We then re-imported the data and everything seems to be running just fine.
We have redeployed the EAR file, uploaded the models, etc. Everything seemed to be working just great.

Now, as of today, when we tried to push all of these changes to our NEW production server (which is mirrored from our development server) and pull over the old production data, the application will no longer deploy. We finally got it to deploy after two hours of trying only to find out that it started crashing to the point where no one can log in.

The exception is saying that the "EventDetail_ID" column is not found. Which makes me believe that the CURRENTLY RUNNING MODEL INSTANCES are case-sensitive and are looking for the old, mixed case column.

In our testing, we didn't seem to find this problem but that may have been because our testing mostly focused on creating new tickets (which would use the new, upper-case model).

Since we have several hundred open tickets, we can't really wait for all of them to close out before we can do another deploy. I understand that a drastic schema change would cause problems with the old and the new but this was just renaming a column to the same name only upper case.

AND, I can log into the DB2 server using the same credentials and query the column using any sort of casing I want. So the DB2 server doesn't seem to care if I use:

select EventDetail_ID from TBL.EVENTDETAILS;
or
select EVENTDETAIL_ID from TBL.EVENTDETAILS;
or even
select eventDETAIL_iD from TBL.EVENTDETAILS;

All of those work just fine.

So, if anyone has a solution to this problem we would be very grateful. This problem is holding up a production deployment for a very important client.

Below you will find a sample of our exception logs. Please let me know if you need any more details.

Thank you.

-cecil meeks


Code: Select all
[#|2014-05-14T15:58:13.565-0400|WARNING|oracle-glassfish3.1.2|org.hibernate.util.JDBCExceptionReporter|_ThreadID=1057;_ThreadName=Thread-2;|SQL Error: -205, SQLState: 42703|#]

[#|2014-05-14T15:58:13.565-0400|SEVERE|oracle-glassfish3.1.2|org.hibernate.util.JDBCExceptionReporter|_ThreadID=1057;_ThreadName=Thread-2;|[SQL0205] Column "EventDetail_ID" not in table TICKET in LSPS_LITE.|#]

[#|2014-05-14T15:58:13.565-0400|SEVERE|oracle-glassfish3.1.2|com.whitestein.lsps.human.DocumentServiceBean|_ThreadID=1057;_ThreadName=Thread-2;|Error invoking method public com.whitestein.lsps.human.dto.ListDocument com.whitestein.lsps.human.DocumentServiceBean.getListDocument(java.lang.String,com.whitestein.lsps.human.dto.DocumentParameters,com.whitestein.lsps.common.query.OrderingAndPagingCriteria,com.whitestein.lsps.human.dto.Document) throws com.whitestein.lsps.human.exception.DocumentNotFoundException,com.whitestein.lsps.human.exception.IncorrectDocumentTypeException,com.whitestein.lsps.common.ErrorException,com.whitestein.lsps.human.exception.DocumentStateException
com.whitestein.lsps.common.ErrorRuntimeException: could not execute query, error code: DatabaseError
   at com.whitestein.lsps.engine.sharedrecord.RuntimeToHibernateConverter.convertHibernateException(RuntimeToHibernateConverter.java:164)
   at com.whitestein.lsps.engine.sharedrecord.QueryExecutor.getResultList(QueryExecutor.java:230)
   at com.whitestein.lsps.human.DocumentServiceBean.getBusinessObjects(DocumentServiceBean.java:1057)
   at com.whitestein.lsps.human.DocumentServiceBean.getListDocument(DocumentServiceBean.java:616)
   at sun.reflect.GeneratedMethodAccessor798.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
   at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
   at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
   at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
   at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
   at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
   at com.whitestein.lsps.common.SecureAndLoggingService.logInvocation(SecureAndLoggingService.java:147)
   at com.whitestein.lsps.common.SecureAndLoggingService.logErrorsAndInvocation(SecureAndLoggingService.java:112)
   at com.whitestein.lsps.common.SecureAndLoggingService.secureAndLog(SecureAndLoggingService.java:77)
   at sun.reflect.GeneratedMethodAccessor529.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at com.sun.ejb.containers.interceptors.BeanAroundInvokeInterceptor.intercept(InterceptorManager.java:902)
   at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
   at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
   at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
   at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
   at sun.reflect.GeneratedMethodAccessor496.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
   at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
   at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
   at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
   at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
   at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
   at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
   at com.sun.proxy.$Proxy431.getListDocument(Unknown Source)
   at com.whitestein.lsps.human.web.bean.DocumentBeanBase.acceptDocument(DocumentBeanBase.java:723)
   at com.kenco.lite.webapp.bean.DocumentBean.displayDocument(DocumentBean.java:310)
   at com.kenco.lite.webapp.bean.DocumentBean.openCustomWorklist(DocumentBean.java:370)
   at sun.reflect.GeneratedMethodAccessor912.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at com.sun.el.parser.AstValue.invoke(AstValue.java:254)
   at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)
   at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
   at com.whitestein.lsps.web.component.PageActionComponent.encodeBegin(PageActionComponent.java:60)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
   at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
   at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
   at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
   at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
   at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
   at com.whitestein.lsps.web.multipart.MultipartFilter.doFilter(MultipartFilter.java:103)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
   at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
   at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
   at java.lang.Thread.run(Thread.java:744)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
   at org.hibernate.loader.Loader.doList(Loader.java:2235)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
   at org.hibernate.loader.Loader.list(Loader.java:2124)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
   at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
   at com.whitestein.lsps.engine.sharedrecord.QueryExecutor.getResultList(QueryExecutor.java:218)
   ... 82 more
Caused by: java.sql.SQLException: [SQL0205] Column "EventDetail_ID" not in table TICKET in LSPS_LITE.
   at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650)
   at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621)
   at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1518)
   at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:192)
   at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1920)
   at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1862)
   at com.sun.gjc.spi.base.ConnectionHolder.prepareStatement(ConnectionHolder.java:562)
   at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:255)
   at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:52)
   at com.sun.gjc.spi.ManagedConnection.prepareCachedStatement(ManagedConnection.java:993)
   at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareStatement(ConnectionWrapper40.java:173)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
   at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
   at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
   at org.hibernate.loader.Loader.doQuery(Loader.java:696)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
   at org.hibernate.loader.Loader.doList(Loader.java:2232)
   ... 90 more
|#]

[#|2014-05-14T15:58:13.659-0400|WARNING|oracle-glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=1057;_ThreadName=Thread-2;|EJB5184:A system exception occurred during an invocation on EJB DocumentServiceBean, method: public com.whitestein.lsps.human.dto.ListDocument com.whitestein.lsps.human.DocumentServiceBean.getListDocument(java.lang.String,com.whitestein.lsps.human.dto.DocumentParameters,com.whitestein.lsps.common.query.OrderingAndPagingCriteria,com.whitestein.lsps.human.dto.Document) throws com.whitestein.lsps.human.exception.DocumentNotFoundException,com.whitestein.lsps.human.exception.IncorrectDocumentTypeException,com.whitestein.lsps.common.ErrorException,com.whitestein.lsps.human.exception.DocumentStateException|#]

[#|2014-05-14T15:58:13.659-0400|WARNING|oracle-glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=1057;_ThreadName=Thread-2;|javax.ejb.EJBException
   at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5215)
   at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5113)
   at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4915)
   at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2045)
   at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
   at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
   at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
   at com.sun.proxy.$Proxy431.getListDocument(Unknown Source)
   at com.whitestein.lsps.human.web.bean.DocumentBeanBase.acceptDocument(DocumentBeanBase.java:723)
   at com.kenco.lite.webapp.bean.DocumentBean.displayDocument(DocumentBean.java:310)
   at com.kenco.lite.webapp.bean.DocumentBean.openCustomWorklist(DocumentBean.java:370)
   at sun.reflect.GeneratedMethodAccessor912.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at com.sun.el.parser.AstValue.invoke(AstValue.java:254)
   at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)
   at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
   at com.whitestein.lsps.web.component.PageActionComponent.encodeBegin(PageActionComponent.java:60)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
   at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
   at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
   at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
   at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
   at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
   at com.whitestein.lsps.web.multipart.MultipartFilter.doFilter(MultipartFilter.java:103)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
   at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
   at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
   at java.lang.Thread.run(Thread.java:744)
Caused by: com.whitestein.lsps.common.ErrorRuntimeException: could not execute query, error code: DatabaseError
   at com.whitestein.lsps.engine.sharedrecord.RuntimeToHibernateConverter.convertHibernateException(RuntimeToHibernateConverter.java:164)
   at com.whitestein.lsps.engine.sharedrecord.QueryExecutor.getResultList(QueryExecutor.java:230)
   at com.whitestein.lsps.human.DocumentServiceBean.getBusinessObjects(DocumentServiceBean.java:1057)
   at com.whitestein.lsps.human.DocumentServiceBean.getListDocument(DocumentServiceBean.java:616)
   at sun.reflect.GeneratedMethodAccessor798.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
   at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
   at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
   at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
   at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
   at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
   at com.whitestein.lsps.common.SecureAndLoggingService.logInvocation(SecureAndLoggingService.java:147)
   at com.whitestein.lsps.common.SecureAndLoggingService.logErrorsAndInvocation(SecureAndLoggingService.java:112)
   at com.whitestein.lsps.common.SecureAndLoggingService.secureAndLog(SecureAndLoggingService.java:77)
   at sun.reflect.GeneratedMethodAccessor529.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at com.sun.ejb.containers.interceptors.BeanAroundInvokeInterceptor.intercept(InterceptorManager.java:902)
   at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
   at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
   at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
   at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
   at sun.reflect.GeneratedMethodAccessor496.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
   at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
   at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
   at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
   at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
   at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
   ... 51 more
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
   at org.hibernate.loader.Loader.doList(Loader.java:2235)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
   at org.hibernate.loader.Loader.list(Loader.java:2124)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
   at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
   at com.whitestein.lsps.engine.sharedrecord.QueryExecutor.getResultList(QueryExecutor.java:218)
   ... 82 more
Caused by: java.sql.SQLException: [SQL0205] Column "EventDetail_ID" not in table TICKET in LSPS_LITE.
   at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650)
   at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621)
   at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1518)
   at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:192)
   at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1920)
   at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1862)
   at com.sun.gjc.spi.base.ConnectionHolder.prepareStatement(ConnectionHolder.java:562)
   at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:255)
   at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:52)
   at com.sun.gjc.spi.ManagedConnection.prepareCachedStatement(ManagedConnection.java:993)
   at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareStatement(ConnectionWrapper40.java:173)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
   at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
   at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
   at org.hibernate.loader.Loader.doQuery(Loader.java:696)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
   at org.hibernate.loader.Loader.doList(Loader.java:2232)
   ... 90 more
|#]


Martin Vysny
 
Posts: 51
Joined: Thu Dec 12, 2013 9:39 am

Re: Can no longer deploy after column was renamed.

Thu May 15, 2014 9:33 am

Thank you for your message. Column names in DB2 are case insensitive unless wrapped in quotes: http://bytes.com/topic/db2/answers/4739 ... lumn-names
Please try
Code: Select all
select "eventDETAIL_iD" from TBL.EVENTDETAILS;

- it should fail. We internally use Hibernate which wraps table names in quotes.

cbmeeks
 
Posts: 59
Joined: Wed Aug 07, 2013 11:28 pm

Re: Can no longer deploy after column was renamed.

Thu May 15, 2014 6:40 pm

Thank you for your reply.

However, I may not have explained clearly enough.

We are having the following problems based on what I explained above:

1) Old models (deployed with the lower-case column name) are still looking for the lower case version which no longer exists. I don't know of a way to update them to the upper case version without closing them all out.

2) The entire engine seems to allow a few tickets to be created after I do a complete deploy of the EAR file. But after a short amount of time, no one can even log into the application without being presented with a 500 error. The entire application is broken at that point.

Thank you.

-cecil meeks

Ondrej Danko
 
Posts: 31
Joined: Mon Feb 27, 2012 1:14 pm

Re: Can no longer deploy after column was renamed.

Thu May 15, 2014 7:16 pm

Hi Cecil,

my understanding is following: In the system you have a model (lets call it OLD model) with "TICKET"."EventDetail_ID" (mixed case) column realizing ono-to-one association. There are many model instances of the OLD model. You have uploaded a NEW model, where you renamed "TICKET"."EventDetail_ID" column to "TICKET"."EVENTDETAIL_ID". There are some model instances of the NEW model already in the system (correct me if I'm wrong). You have also updated database schema, so that it now contains "TICKET"."EVENTDETAIL_ID" column.

The problem is that LSPS uses Hibernate as ORM tool. From Hibernate's point of view "TICKET"."EventDetail_ID" and "TICKET"."EVENTDETAIL_ID" are two different columns, i.e. hibernate is case sensitive. Therefore, if query is executed from model instance running according to OLD model, the select will look like 'Select "ID", "EventDetail_ID", ... from "TICKET"'. If the query is executed from model instance running according to NEW mode, the select will look like 'Select "ID", "EVENTDETAIL_ID", ... from "TICKET"'. The first select will fail, because there is no "EventDetail_ID" column in the database (surrounding quotes which are added by hibernate makes it case sensitive). Second select will work fine.

Cecil, one question: are we speaking about production environment?

I think we have following options to solve the issue:
1) "Model update" all model instances running according to OLD model, so that they use some new version of the model which has EVENTDETAIL_ID in uppercase (consistent with DB).
2) If we are not speaking about production environment, I would recommend to revert the rename of the column. Is it a big issue that one column is in mixed case?

Thank you.

Ondrej Danko
 
Posts: 31
Joined: Mon Feb 27, 2012 1:14 pm

Re: Can no longer deploy after column was renamed.

Thu May 15, 2014 9:42 pm

Hi,

there is one more "hacky" solution which you might consider if we are speaking about production environment and the fix should be provided ASAP:

1) create "EventDetail_ID" column (DB2 allows two columns with the same name with different letters-case)
Code: Select all
alter table TICKET add "EventDetail_ID" integer

2) synchronize "EventDetail_ID" and "EVENTDETAIL_ID"
Code: Select all
update TICKET
set "EventDetail_ID" = "EVENTDETAIL_ID"

3) create post insert/update triggers which will keep both columns synchronized

cbmeeks
 
Posts: 59
Joined: Wed Aug 07, 2013 11:28 pm

Re: Can no longer deploy after column was renamed.

Thu May 15, 2014 9:47 pm

Ah, I see what you're saying.

You're basically just giving Hibernate what it needs so that the old models can continue on.

Let me run that by some people and see what they think.

We're also looking into a real migration plan but I haven't had any experience with the LSPS model migrations.

Thank you for your reply.

Return to Management

Who is online

Users browsing this forum: No registered users and 1 guest