Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Connection LifeTime

Connection LifeTime

Scheduled Pinned Locked Moved Database
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hashok
    wrote on last edited by
    #1

    Hello.... I am trying to understand this parameter "Connection LifeTime" in the connection string. The definition says "Connection Lifetime - When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by Connection Lifetime. A value of zero (0) causes pooled connections to have the maximum connection timeout. " Connection Lifetime - if I set the value for this to be 5 secs, does it mean that after I close my connection, and gets returned to the pool, and if the difference of the creation time and the returned time is greater than 5 secs, will the connection be available for use immediately, from the connection pool? Or do I loose this connection from the pool? Or am I reading it incorrectly? What is the maximum connection timeout? Please advice... Thank You

    A 1 Reply Last reply
    0
    • H hashok

      Hello.... I am trying to understand this parameter "Connection LifeTime" in the connection string. The definition says "Connection Lifetime - When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by Connection Lifetime. A value of zero (0) causes pooled connections to have the maximum connection timeout. " Connection Lifetime - if I set the value for this to be 5 secs, does it mean that after I close my connection, and gets returned to the pool, and if the difference of the creation time and the returned time is greater than 5 secs, will the connection be available for use immediately, from the connection pool? Or do I loose this connection from the pool? Or am I reading it incorrectly? What is the maximum connection timeout? Please advice... Thank You

      A Offline
      A Offline
      Ali Rashid
      wrote on last edited by
      #2

      Simply, connection timeouts refer to the time it takes the Server to run a query and generate a result. If you reach connection timeout, your conenction to the database will be terminated and you will need to re-initialise the connection to the database. When we talk about Pooling, what that refers to is that when you try and make a connection to the database, the server tries to make contact with the database engine. If you set the timeout value to 5, it will try for 5 seconds and if no connection has been established, it will return you an error (Connection Timeout). Which means that you didnt have a connection to begin with. If you do establish a connection and then leave the connection (Close()), you will again lose the connection and you will need to go through the same process of establishing the connection. Hope that this helps. Regards, Ali

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups