views:

31

answers:

2

Each time I run my application it creates a connection to the Oracle database (pretty typical). The problem I'm running into is that, when I kill the debugger to stop the application the code to close the database connection never gets called.

Oracle doesn't seem to realize that those connections are now unimportant and it tries to keep the connection open. Eventually, I run into errors and problems because there aren't any available connections.

It seems like this has to be a common problem. But I couldn't find anything about how to fix it.

Suggestions?

+1  A: 

That is strange. Oracle must drop connection, if not instantly, but with some interval. Anyway, you can write a program to select connections from your program and your machine and drop them. Run it in some intervals. See http://www.techper.net/2008/02/04/killing-an-oracle-session-using-sql/

Dmitry
+1  A: 

You need to add the SQLNET.EXPIRE_TIME clause to your sqlnet.ora file.

steve