R2.4.0.4616 使用MSSQL数据库 无法删除表单及视图

 R2.4.0.4616 已打patch1 使用MSSQL数据库 无法删除表单及视图 , Web页面无错误提示。后台错误提示为:
13:44:13,887 WARN JDBCExceptionReporter:77 - SQL Error: 402, SQLState: S1000 13:44:13,888 ERROR JDBCExceptionReporter:78 - 数据类型 ntext 和 varchar 在 equal to 运算符中不兼容。 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:2214) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095) at org.hibernate.loader.Loader.list(Loader.java:2090) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375) 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 cn.myapps.base.dao.HibernateBaseDAO.getDatas(HibernateBaseDAO.java:239) at cn.myapps.base.dao.HibernateBaseDAO.getDatas(HibernateBaseDAO.java:95) at cn.myapps.core.dynaform.view.ejb.ViewProcessBean.doRemove(ViewProcessBean.java:240) at cn.myapps.core.dynaform.view.ejb.ViewProcessBean$$EnhancerByCGLIB$$4aeca9c9.CGLIB$doRemove$1(<generated>) at cn.myapps.core.dynaform.view.ejb.ViewProcessBean$$EnhancerByCGLIB$$4aeca9c9$$FastClassByCGLIB$$1393633f.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167) at cn.myapps.util.ProcessFactory.intercept(ProcessFactory.java:138) at cn.myapps.core.dynaform.view.ejb.ViewProcessBean$$EnhancerByCGLIB$$4aeca9c9.doRemove(<generated>) at cn.myapps.base.ejb.AbstractDesignTimeProcessBean.doRemove(AbstractDesignTimeProcessBean.java:162) at cn.myapps.core.dynaform.view.ejb.ViewProcessBean$$EnhancerByCGLIB$$4aeca9c9.CGLIB$doRemove$23(<generated>) at cn.myapps.core.dynaform.view.ejb.ViewProcessBean$$EnhancerByCGLIB$$4aeca9c9$$FastClassByCGLIB$$1393633f.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167) at cn.myapps.util.ProcessFactory.intercept(ProcessFactory.java:138) at cn.myapps.core.dynaform.view.ejb.ViewProcessBean$$EnhancerByCGLIB$$4aeca9c9.doRemove(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.jamonapi.proxy.MonProxy.invoke(MonProxy.java:110) at $Proxy11.doRemove(Unknown Source) at cn.myapps.base.action.BaseAction.doDelete(BaseAction.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:365) at com.opensymphony.xwork.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:217) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:191) at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:137) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:81) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:81) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:171) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:100) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189) at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113) at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:233) at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:198) at cn.myapps.base.web.filter.OBPMFilterDispatcher.doFilter(OBPMFilterDispatcher.java:43) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at cn.myapps.base.web.filter.AjaxMultiLanguageFilter.doFilter(AjaxMultiLanguageFilter.java:40) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at cn.myapps.base.web.filter.PersistenceFilter.doFilter(PersistenceFilter.java:30) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at cn.myapps.base.web.filter.SecurityFilter.doFilter(SecurityFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.SQLException: 数据类型 ntext 和 varchar 在 equal to 运算符中不兼容。 at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254) ... 91 more

 

解决方案:

 

在“void cn.myapps.core.dynaform.view.ejb.ViewProcessBean.doRemove(String viewId)”中

PersistenceUtils.beginTransaction();// 启动事务 IDesignTimeDAO linkDAO = DAOFactory.getDefaultDAO(LinkVO.class.getName()); // 查询视图id(viewid) = "viewId" 的所有关联链接(Link) Iterator it_Link = linkDAO.getDatas("from LinkVO lv where lv.actionContent='" + viewId + "'").iterator();

改为:

PersistenceUtils.beginTransaction();// 启动事务 IDesignTimeDAO linkDAO = DAOFactory.getDefaultDAO(LinkVO.class.getName()); // 查询视图id(viewid) = "viewId" 的所有关联链接(Link) Iterator it_Link = linkDAO.getDatas("from LinkVO lv where convert(nvarchar,lv.actionContent)='" + viewId + "'").iterator();

你可能感兴趣的:(R2.4.0.4616 使用MSSQL数据库 无法删除表单及视图)