Hibernate会话无法打开事务问题

时间:2016-05-06 10:20:42

标签: mysql jdbc transactions

嗨,我知道这是一个重复的问题,很多人都遇到过这个问题。

我也得到了同样的错误,我想问题是我的sql配置。

datasource.maxActive = 100

datasource.maxIdle = 10

datasource.maxWait = 1000

我是否需要更改datasource.maxIdle以消除此错误?以下是错误

错误2016-05-05 05:45:55,008 [[gmp] .Execute Data Prep.9] com.vnu.gmp.mule.consumers.ExecuteDataPrepConsumer:ExecuteDataPrepConsumer失败,studyTag [S000001] workflowname [wf_Process_Data]的异常和taskname [wklt_CMN_Initial_Load]。

org.springframework.transaction.CannotCreateTransactionException:无法打开Hibernate Session进行事务处理;嵌套异常是org.hibernate.TransactionException:JDBC开始失败:

    at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:596)

    at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)

    at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:316)

    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    at sun.proxy.$Proxy73.findById(Unknown Source)

    at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)


    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    at com.vnu.gmp.common.aop.methodinterceptor.PerformanceInterceptor.invoke(PerformanceInterceptor.java:97)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)


    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    at sun.proxy.$Proxy73.findById(Unknown Source)

    at com.vnu.gmp.mule.consumers.ExecuteDataPrepConsumer.onCall(ExecuteDataPrepConsumer.java:218)

    at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)


    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    at sun.proxy.$Proxy354.onCall(Unknown Source)

    at org.mule.model.resolvers.CallableEntryPointResolver.invoke(CallableEntryPointResolver.java:50)

    at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:45)


    at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:350)

    at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:90)

    at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:81)

    at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:113)

    at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:51)


    at org.mule.component.AbstractComponent$1.process(AbstractComponent.java:241)

    at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessageProcessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:185)

    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)

    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:37)

    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)


    at com.vnu.gmp.mule.interceptor.OpenHibernateSessionInEnvelopeInterceptor.process(OpenHibernateSessionInEnvelopeInterceptor.java:93)

    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)

    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:37)

    at org.mule.processor.builder.InterceptingChainCompositeMessageProcessor.process(InterceptingChainCompositeMessageProcessor.java:65)

    at org.mule.component.AbstractComponent.process(AbstractComponent.java:146)


    at org.mule.service.processor.ServiceInternalMessageProcessor.process(ServiceInternalMessageProcessor.java:56)

    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)

    at org.mule.processor.SedaStageInterceptingMessageProcessor$SedaStageWorker.doRun(SedaStageInterceptingMessageProcessor.java:170)

    at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:41)

    at org.mule.work.WorkerContext.run(WorkerContext.java:309)


    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)

    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)

    at java.lang.Thread.run(Thread.java:662)

引起:org.hibernate.TransactionException:JDBC开始失败:

    at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)


    at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)

    at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:555)

    ... 52 more

引起:com.mysql.jdbc.CommunicationsException:由于基础异常导致通信链接失败:

**开始没有异常**

java.io.EOFException的

堆栈跟踪:

java.io.EOFException的

    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)

    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)


    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)

    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)

    at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)

    at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5215)

    at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:268)


    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:293)

    at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)

    at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)

    at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:555)

    at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)


    at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:316)

    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

     at sun.proxy.$Proxy73.findById(Unknown Source)


    at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)


    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    at com.vnu.gmp.common.aop.methodinterceptor.PerformanceInterceptor.invoke(PerformanceInterceptor.java:97)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    at sun.proxy.$Proxy73.findById(Unknown Source)


    at com.vnu.gmp.mule.consumers.ExecuteDataPrepConsumer.onCall(ExecuteDataPrepConsumer.java:218)

    at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)


    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)


    at sun.proxy.$Proxy354.onCall(Unknown Source)

    at org.mule.model.resolvers.CallableEntryPointResolver.invoke(CallableEntryPointResolver.java:50)

    at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:45)

    at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:350)

    at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:90)


    at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:81)

    at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:113)

    at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:51)

    at org.mule.component.AbstractComponent$1.process(AbstractComponent.java:241)

    at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessageProcessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:185)


    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)

    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:37)

    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)

    at com.vnu.gmp.mule.interceptor.OpenHibernateSessionInEnvelopeInterceptor.process(OpenHibernateSessionInEnvelopeInterceptor.java:93)

    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)


    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:37)

    at org.mule.processor.builder.InterceptingChainCompositeMessageProcessor.process(InterceptingChainCompositeMessageProcessor.java:65)

    at org.mule.component.AbstractComponent.process(AbstractComponent.java:146)

    at org.mule.service.processor.ServiceInternalMessageProcessor.process(ServiceInternalMessageProcessor.java:56)

    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)


    at org.mule.processor.SedaStageInterceptingMessageProcessor$SedaStageWorker.doRun(SedaStageInterceptingMessageProcessor.java:170)

    at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:41)

    at org.mule.work.WorkerContext.run(WorkerContext.java:309)

    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)

    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)


    at java.lang.Thread.run(Thread.java:662)

**结束了例外**

发送到服务器的最后一个数据包是1毫秒前。

    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2515)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)


    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)

    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)

    at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)

    at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5215)

    at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:268)


    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:293)

    at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)

    ... 54 more

INFO 2016-05-05 05:45:56,096 [[gmp] .Execute HLM Sas Consumer.31] com.vnu.gmp.mule.consumers.SASProgramImpl:成功执行executeSas。 DETAILS:modelTag [M000059] iterationId [5081]

INFO 2016-05-05 05:45:56,265 [[gmp] .Execute DeckVol Supplement.28] com.vnu.gmp.mule.consumers.ExecuteDeckVolSupplementSasConsumer:成功执行executeSasIteration。 DETAILS:modelTag [M000446] iterationId [1557]

INFO 2016-05-05 05:45:55,812 [[gmp] .Execute Market Contributions.37] com.vnu.gmp.mule.consumers.SASProgramImpl:ExecuteSasIteration EXE:/ work / gmp / prod / scripts / bin /StartIterationSASProgram.sh -r prod -g M000446 -i 1557 -p create_store_week_itemsold_file -R

INFO 2016-05-05 05:45:57,443 [[gmp] .Execute Market Contributions.37] com.vnu.gmp.mule.consumers.SASProgramImpl:成功执行executeSas。 DETAILS:modelTag [M000446] iterationId [1557]

INFO 2016-05-05 05:45:57,444 [[gmp] .Execute Market Contributions.37] com.vnu.gmp.mule.consumers.ExecuteInputToMarketContributions:ExecuteInputToMarketContributions成功用于M000446,iter_1557

INFO 2016-05-05 05:45:58,836 [[gmp] .Execute HLM Sas Consumer.31] com.vnu.gmp.mule.consumers.SASProgramImpl:ExecuteSasIteration EXE:/ work / gmp / prod / scripts / bin / StartIterationSASProgram.sh -r prod -g M000059 -i 5081 -p create_varmpout -R

INFO 2016-05-05 05:46:05,159 [[gmp] .Execute DeckVol Supplement.22] com.vnu.gmp.mule.consumers.ExecuteDeckVolSupplementSasConsumer:成功执行executeSasIteration。 DETAILS:modelTag [M000446] iterationId [1579]

INFO 2016-05-05 05:46:05,202 [[gmp] .Execute Market Contributions.35] com.vnu.gmp.mule.consumers.SASProgramImpl:ExecuteSasIteration EXE:/ work / gmp / prod / scripts / bin /StartIterationSASProgram.sh -r prod -g M000446 -i 1579 -p create_store_week_itemsold_file -R

INFO 2016-05-05 05:46:06,278 [[gmp] .Execute Market Contributions.35] com.vnu.gmp.mule.consumers.SASProgramImpl:成功执行executeSas。 DETAILS:modelTag [M000446] iterationId [1579]

INFO 2016-05-05 05:46:06,279 [[gmp] .Execute Market Contributions.35] com.vnu.gmp.mule.consumers.ExecuteInputToMarketContributions:ExecuteInputToMarketContributions成功为M000446,iter_1579

INFO 2016-05-05 05:46:10,218 [[gmp] .Execute BdDrillDownConsumer.25] com.vnu.gmp.mule.consumers.BdDrillDownConsumer:成功执行executeSasIteration。 DETAILS:modelTag [M000059] iterationId [4959]

INFO 2016-05-05 05:46:10,218 [[gmp] .Execute BdDrillDownConsumer.25] com.vnu.gmp.mule.consumers.BdDrillDownConsumer:已完成的BD深入研究SAS计划

INFO 2016-05-05 05:46:10,218 [[gmp] .Execute BdDrillDownConsumer.25] com.vnu.gmp.mule.consumers.BdDrillDownConsumer:对于modelTag,BdDrillDownConsumer的执行成功:M000059,iterationId:4959 ,batchId:111

0 个答案:

没有答案