Skip to main content

Posts

Showing posts from May, 2011

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.drive

Database usage in development and testing environment

In development environment we have access to the database in the read and write mode, where we can play with tables. Instead of writing simple queries to update any tuple, we use for update functionality of the PL/SQL. But it is a bad idea, since we are blocking other users who are operating on the same table, since for update table the lock on the full table, and noone is allowed to perform any operation untill the lock is released. select * from table_name for update; Instead of the above query write a simple update query. update table_name set column_to_set = value_to_set where column_where_condition = value_where_condition; This is better idea to practice, or you can simple create a query as mentioned below : update &table_name set &to_set_column_name = &value_to_set_column_name where &where_column_name = &value_where_column_name; This will help the user to input all the details at runtime. But still in the testing environment, when the developers don&#

Hash Outer Right Join

As mentioned in the earlier tips, outer join can be done by 3 different techniques. But, from Oracle 10g onwards, Oracle has started to provide the fourth technique to handle the outer join. ·          Nested loop outer join ·          Hash outer join ·          Hash outer right join (from Oracle 10g onwards) ·          Merge outer join Hash outer right join has been provided by Oracle from 10g version onwards. This technique has been introduced in order to overcome the design flaw of hash outer join. As per the definition of hash outer right join, the smallest of the two tables (where-in outer join is used) will be used to build the hash table, and the other table will be used as the probe table unlike hash outer join, wherein the size of the tables doesn’t play any role and the parent & child table must be used as hash & probe tables respectively. Hash outer right join will be preferred over hash outer join only if a child table(rows don’t need to be preserved) is outer-j