Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

About ODP.NET Connection Lifetime Attribute Question?

EasonLiuApr 20 2016 — edited Apr 26 2016

Hi @"Alex Keh - Product Manager-Oracle"

In document Says Connection Lifetime Attribute:

When the application closes a connection, the connection pooling service determines whether or not the connection lifetime has exceeded the value of the Connection Lifetimeattribute. If so, the connection pooling service closes the connection; otherwise, the connection goes back to the connection pool. The connection pooling service enforces the ConnectionLifetime only when a connection is going back to the connection pool.


use Test code e.g:

void TestPerformance()

{

      string connStr = @"Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =IP)(PORT =1521)))

(CONNECT_DATA =(SERVICE_NAME = *)));user id=*;password=*;Pooling =true;Connection lifeTime=600;Max Pool Size=100;Min Pool Size=1;"

       OracleConnection oraConn = new OracleConnection(connStr);

       try

       {

           oraConn.Open();     

       }

       finally

       {

          if (oraConn != null)

          {

             oraConn.Close();

             oraConn.Dispose();

          }

        }

}

static void Main()

{

     TestPerformance();

    Thread.Sleep(6000);//Sleep six seconds

     TestPerformance();//Current liftTime enquels four seconds?

}

My question is the same program and connection string, will reset the connection lifetime Attribute when second connection is opened?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2016
Added on Apr 20 2016
6 comments
2,223 views