weblogic做服务器,今天进行了并发的测试性能,100的并大量,但是出现如下错误。
(并发中调用了数据库,没调用一次建立一个连接,由于是并发环境,导致连接池资源耗尽)
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:545) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:315) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:234) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:93) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy95.getAgentGgDocumentDto(Unknown Source) at com.sinosoft.application.print.rpcservice.impl.PrintRpcServiceImpl.getBatchEReport(PrintRpcServiceImpl.java:161) ... 16 more Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85) at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354) at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:517) ... 23 more Caused by: weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool sinosoftDataSource to allocate to applications, please increase the size of the pool and retry.. at weblogic.jdbc.common.internal.JDBCUtil.wrapAndThrowResourceException(JDBCUtil.java:252) at weblogic.jdbc.pool.Driver.connect(Driver.java:161) at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:651) at weblogic.jdbc.jts.Driver.connect(Driver.java:127) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 28 more
这个问题是数据连接池不够用了,将其设置为更大的数值(比如:100),这个问题解决。
2.第二个问题,当我数据连接池够用的情况下,出现connection reset.
第一种可能:请求的资源(项目)性能达到了最大,导致不能处理过多的请求,连接被强制结束(客户端达到了关闭请求的条件)(服务端项目性能问题)
第二种可能:weblogic设置了做大的连接数量(连接线程池),导致过的的请求直接被拒绝,连接重置 (weblogic配置问题)