并发大的时候,出现以下错误:
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
解决方法:
1.--数据库允许的连接数
select value from v$parameter where name = 'processes';确定是否太小.
2.查看连接池配置
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@xxxxxxxxxxxxxx"/>
<property name="username" value="xxx"/>
<property name="password" value="xxx"/>
<property name="initialSize" value="20"/>
<property name="maxActive" value="200"/><!--最大200个连接-->
<property name="maxIdle" value="100"/><!--空闲时保持100个连接-->
<property name="maxWait" value="3000"/>
<property name="defaultAutoCommit" value="true"/>
<property name="removeAbandoned" value="true"/>
</bean>