Why session remains inactive when connection is closed and disposed?

Why session remains inactive when connection is closed and disposed?

Postby akkhhennatton » Wed 13 Feb 2013 13:50

Hi !!

Please, forgive my poor english grammar, but I'm Spanish. I'll do my best in order to understand me.
I have been trying the "dotConnect for Oracle", in a VB.NET application.
I have noticed that, when the Connection is Opened, an Inactive thread is shown in the Server, as connected. This is right. No operations have been made, so it remains inactive.
The problem is when I try to "Close" and "Dispose" the Connection (built in runtime). The connection closes... yes.... but the "Inactive" session remains. It's not until 5 minutes when the Oracle Database "releases" this session from "inactive".
This wouldn't matter if I wouldn't work with more than 800 sessions at the same time, and most of them connect to the Database with a period of time less than 10 or 15 seconds.

I need to CONNECT and to DISCONNECT as soon as possible, because I can't let remain 800 sessions INACTIVE because the Oracle Server does not support this.

WHY WHEN I "CLOSE" the Connection.... does not disappear the session in the Oracle DataBase until 5 minutes later?. In the last ODAC components - for Delphi 6 -, the session was released immediately. Is this a bug in "dotConnect for Oracle" components?.
If not... Can you explain to me how to order the Database to release this "thread" or session that remains inactive for more than 5 minutes, in spite of being closed and disposed?

Thank you very much.

Regards
akkhhennatton
 
Posts: 1
Joined: Wed 13 Feb 2013 13:38

Re: Why session remains inactive when connection is closed and disposed?

Postby Pinturiccio » Fri 15 Feb 2013 09:13

dotConnect for Oracle uses connection pooling. The OracleConnection connection string has the Pooling parameter. If Pooling=true (the default value), the connection is not deleted after closing it, it is placed to the pool instead. When a new connection with the same connection string is opened, it is taken from the pool (if there are free connections) instead of the creating a new one. This provides significant performance improvements.

akkhhennatton wrote:This wouldn't matter if I wouldn't work with more than 800 sessions at the same time, and most of them connect to the Database with a period of time less than 10 or 15 seconds.

If you use 800 connections that are connected for 10-15 seconds each, and there are only few different connection strings, you may not have 800 actual connections. Closed connections will be placed to the pool, and they will be taken from the pool when a new connection with the same connection string will open. No additional connection will open in such case.

You can disable Pooling by adding 'Pooling=false' to the connection string. In such case, a connection will be deleted from memory and free the session. However this may lead to performance loss.

Most likely, pooling should not cause creating too much sessions. Try testing your application with pooling on. If the session number will be too large, you can disable pooling.

For more information, please refer to http://www.devart.com/dotconnect/oracle/docs/FAQ.html#q54
Pinturiccio
Devart Team
 
Posts: 2044
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle