I’m using Spring framework + Hibernate Oracle and DAO Pattern. I have over 1000 data for in a suite, When i use for loop for adding tests, I found Oracle error “ORA-12519, TNS:no appropriate service handler found” .Here some stack trace.
WARN JDBCExceptionReporter - SQL Error: 0, SQLState: null ERROR JDBCExceptionReporter - Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1522:orcl
Cause: Oracle doesn’t release connection resources as fast as you open/close them.
Resolve: use Thread.sleep()
For loop {
….
// do statement
// save , update , delete or other command
// after save , update , delete or other command ,sleep for oracle release connection
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
} // end for
Or Resolve : set Connection pool in proprety in hibernate configulation
hibernate.connection.pool_size=maximum number of pooled connections
here my ex. configulation