在修改Clob字段时,报错!

java.lang.IllegalStateException: Active Spring transaction synchronization or active JTA transaction with specified [javax.transaction.TransactionManager] required
at org.springframework.jdbc.support.lob.LobCreatorUtils.registerTransactionSynchronization(LobCreatorUtils.java:79)
at org.springframework.orm.hibernate3.support.AbstractLobType.nullSafeSet(AbstractLobType.java:185)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:169)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2015)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2389)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:407)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:705)
at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:701)
at com.telgenius.common.dao.BaseDao.update(BaseDao.java:123)
at com.telgenius.module.bg.managemoveweb.service.MovewebInfoService.update(MovewebInfoService.java:260)
at com.telgenius.module.bg.managemoveweb.service.MovewebInfoService$$FastClassByCGLIB$$c8fe47bd.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:617)
at com.telgenius.module.bg.managemoveweb.service.MovewebInfoService$$EnhancerByCGLIB$$bb3bad61.update(<generated>)
at com.telgenius.module.bg.managemoveweb.controller.MovewebInfoController.editMovewebInfo(MovewebInfoController.java:185)
at com.telgenius.module.bg.managemoveweb.controller.MovewebInfoController$$FastClassByCGLIB$$1a0bd23b.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at com.telgenius.aspect.BgLogAspect.doBasicProfiling(BgLogAspect.java:44)
at sun.reflect.GeneratedMethodAccessor271.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.telgenius.module.bg.managemoveweb.controller.MovewebInfoController$$EnhancerByCGLIB$$380012cb.editMovewebInfo(<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 org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.telgenius.common.filter.CheckSessionFilter.doFilter(CheckSessionFilter.java:123)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.ajaxanywhere.AAFilter.doFilter(AAFilter.java:46)
at net.jcreate.e3.table.E3TableFilter.executeFilter(E3TableFilter.java:255)
at net.jcreate.e3.table.E3TableFilter.doFilter(E3TableFilter.java:59)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.telgenius.common.filter.PermissionFilter.doFilter(PermissionFilter.java:110)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.telgenius.common.filter.BusinessURLProcessorFilter.antiXSS(BusinessURLProcessorFilter.java:498)
at com.telgenius.common.filter.BusinessURLProcessorFilter.doFilter(BusinessURLProcessorFilter.java:88)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
在使用 `exp` 命令导出 Oracle 数据库,如果存在 CLOB 类型的字段,可能会出现报错的情况。这是因为 `exp` 命令默认使用 `varchar2` 类型来处理 CLOB 字段,而 `varchar2` 类型的长度有限制,无法处理过长的 CLOB 字段。 解决这个问题有两种方法: 1. 使用 `expdp` 命令导出数据:`expdp` 命令是 Oracle 数据库的数据泵工具,它可以更好地处理 CLOB 类型的数据。使用 `expdp` 命令导出数据,需要指定 `CLOB` 类型的列使用二进制格式导出,例如: ``` expdp user/password@database tables=table_name directory=dir dumpfile=file_name.dmp lob_as_segment=y ``` 其中,`lob_as_segment=y` 表示将 `CLOB` 类型的列以二进制格式导出。 2. 修改 `exp` 命令的参数:可以通过修改 `exp` 命令的参数来解决 CLOB 字段报错的问题。具体操作如下: 1. 在 `exp` 命令中添加 `-c` 参数,表示以字符格式导出数据。 2. 在 `exp` 命令中添加 `-lob` 参数,表示导出 CLOB 字段。 3. 修改 `NLS_LANG` 环境变量,将其设为 `AMERICAN_AMERICA.AL32UTF8`,表示使用 UTF-8 编码。 示例命令如下: ``` exp user/password@database tables=table_name file=file_name.dmp log=log_name.log rows=yes compress=no direct=no indexes=no triggers=no constraints=no grants=no feedback=1000000 buffer=1000000 consistent=y commit=y statistics=none object_consistent=y recordlength=65535 consistent=y full=y rows=y constraints=n indexes=n grants=n triggers=n feedback=1000000 buffer=1000000 file=file_name.dmp log=log_name.log compress=n consistent=y direct=n rows=y statistics=none file_size=unlimited consistent=y file_name_convert=old_dir:new_dir -c -lob -NLS_LANG=AMERICAN_AMERICA.AL32UTF8 ``` 注意,修改 `NLS_LANG` 环境变量可能会影响其他程序的运行,需要谨慎操作。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值