DAO + Hibernate + Spring then!! java.sql.SQLException: Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found

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

hibernate_conf_in_spring

, ,

  1. ให้ความเห็น

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Connecting to %s

Follow

Get every new post delivered to your Inbox.