When the concurrency is large, the following error occurs:
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:
Solution:
1.-- The number of connections allowed by the database
select value from v$parameter where name = 'processes'; determine if it is too small.
2. View the connection pool configuration
<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>