Skip to main content

Listener refused the connection due to NetExcepti​on

I was testing some piece of code for calculation of new date on the basis of a given pattern and the specified date.
I wrote a method to automate the test cases to generates those patterns and calculate the new date for each date of the specified date of the range of years.
Since there were around 1 million pattern test cases are possible, so I want to insert this data in database for any future reference.
After creating a pattern I was inserting data of the pattern and the calculation date along with the calculated date.
It was working fine.

I was prepare to hit the start button now, after testing different patterns individually.
I hit the run button and it started its executions, but in the middle, I got this error.

java.sql.SQLException: Listener refused the connection with the following error:ORA-12516, TNS:listener could not find available handler with matching protocol stack       at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419)      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)      at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)      at java.sql.DriverManager.getConnection(DriverManager.java:620)      at java.sql.DriverManager.getConnection(DriverManager.java:200)      at com.ofss.fc.infra.jdbc.FCRJConnection.openConnection(FCRJConnection.java:292)      at com.ofss.fc.infra.jdbc.FCRJConnection.getConnection(FCRJConnection.java:241)      at com.ofss.fc.junit.domain.dda.entity.account.facility.instruction.RecurrencePatternAutomation.runQuery(RecurrencePatternAutomation.java:392)      at com.ofss.fc.junit.domain.dda.entity.account.facility.instruction.RecurrencePatternAutomation.createRecurrencePattern(RecurrencePatternAutomation.java:149)      at com.ofss.fc.junit.domain.dda.entity.account.facility.instruction.RecurrencePatternAutomation.main(RecurrencePatternAutomation.java:83)Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:ORA-12516, TNS:listener could not find available handler with matching protocol stack       at oracle.net.ns.NSProtocol.connect(NSProtocol.java:386)      at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054)      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)      ... 11 more


I am not sure about this error, why I got this. I looked database also, since looking at the trace, it seems that the database connection is not available.
But database was up, so it looks strange to me.

Is it possible that, I am firing so many insert queries in such a small interval, that it denied the insert statements.
If anyone faced such an error, please reply back.

Comments

Popular posts from this blog

Bitmap index

Bitmap index is one of the index types that is supported by oracle. Unlike B*tree index, this is very compressed index. It means if I create a bitmap index on a column, then the generated index table will be smaller when compared the index table which is generated by the binary index on the same column. The reason is, in bitmap index, ROWIDs won’t be stored in the index table, instead index values will be mapped against bitmaps. Bitmap is nothing but it stores either of this values, 1(Match) or 0(No Match). For each distinct values in the column, a separate index record will be created. Unlike b*tree index, bitmap index can accept NULL and it creates separate index entry for this. Bitmap index will work better if number of distinct values are relatively less when compared to the total number of records. Why is it referred as “relatively less”? this index will work fine if table of 1,000,000,000 records contains 5000 distinct values and if table of 1,000 records contains 5 distinct va...

Nested Loop Natural Join

When the optimizer tries to finalize the execution plan of a query, it considers a lot of items. It must take the interrelated decisions based on those items. Most important of those items are, Ø   Access path Ø   Join Order Ø   Join Operation Access path tells how the required data is going to be retrieved from a table. So, this tells nothing but which index scan is imposed on that table like index range, index skip scan and so on. Join Order means, to execute a query that joins more than two tables, Oracle joins two of the tables, and then joins the resulting row source to the next table. This process is continued until all tables are joined into the result. It means oracle can join only two tables at most in a time though more than two tables are referred in a query. Oracle always tries to join the small tables first and then joins with the large tables. The reason behind is, it always tries to lower the number of resultant records formed while in the process of jo...

Hash Outer Join

As per the definition of hash outer join, the driving (or parent) table whose rows are being preserved is used to build the hash table, and the driven (or child) table is used to probe the hash table. To perform this hash outer join, Oracle follows these steps (assume, child table has to be outer-joined with parent table): 1.      Oracle chooses parent table as the hash table (otherwise called as driving table). Oracle built the hash table in RAM after applying the hash function on the joining column(s) of the driving table. 2.      Oracle chooses child table as the probe table (otherwise called as driven table or probing table). It traverse through all the records of this probe table, applies the same hash function on the joining column(s) [column(s) used to join these two tables] and will hit the corresponding entry in the hash table. 3.      Oracle returns the output if a record from the driving table is already present in...