For testing exception handling in the case of a broken connection it is useful to be able to programmatically request the database to kill a connection.
What’s the best way to do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here are a couple of bits of code to handle that. This works in a RAC multi-node environment. It assumes you have a TNS entry for each of your cluster instances.
a shell script to kill a connection:
a client-side function (this in python) to generate a call to the script. I call this at the beginning of my test program and print the string so I can cut and paste.
and a sample invocation
and from my client… hooray!!!