在一个service中调用另一个service中的save方法后就会报错。
报错信息:
org.springframework.transaction.IllegalTransactionStateException: Pre-bound JDBC Connection found! HibernateTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single HibernateTransactionManager for all transactions on a single DataSource, no matter whether Hibernate or JDBC access.
at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:427)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
at net.northking.oms.service.scan.impl.SdiBmsArcAccountServiceImpl$$EnhancerByCGLIB$$3347cb1d.saveSdiBmsArc(<generated>)
at net.northking.oms.service.scan.impl.SdiArcArchiveToEcmServiceImpl.sdiArcArchiveToEcm(SdiArcArchiveToEcmServiceImpl.java:84)
at net.northking.oms.service.scan.impl.SdiArcArchiveToEcmServiceImpl$$FastClassByCGLIB$$e336bdb7.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:696)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
at net.northking.oms.service.scan.impl.SdiArcArchiveToEcmServiceImpl$$EnhancerByCGLIB$$cae5997c.sdiArcArchiveToEcm(<generated>)
Hibernate: update SDI_BMS_ARC set CODE=?, NAME=?, DESCRIPTION=?, TYPE=?, INDEX_NO=?, STATUS=?, STATUS_CODE=?, PARENT_ID=?, CREATEOR=?, CREATE_TIME=?, PRIORITY=?, ORG_CODE=?, TELLER_CODE=?, TR_DATE=?, IMAGE_NUM=?, FRONT_NUM=?, DOC_NUM=?, CAPTURER=?, CAPTURE_TIME=?, INPUTER=?, INPUT_TIME=?, OCR_SERVER_ID=?, AUTO_MATCH_SERVER_ID=?, AUDIT_OK_NUM=?, EXCEPTION_REASON=?, IS_NEED_AUTO_MATCH=?, CHECK_IMAGE_TOTAL_FILES=?, CHECK_IMAGE_TOTAL_DB=? where ID=?
at net.northking.oms.struts.action.scan.daemon.SdiAutoUpdateCatelogToDfc.run(SdiAutoUpdateCatelogToDfc.java:46)