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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Connection pool and open & close ...???

Connection pool and open & close ...???

Scheduled Pinned Locked Moved Database
questiondatabaseperformance
2 Posts 2 Posters 1 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.
  • D Offline
    D Offline
    devboycpp
    wrote on last edited by
    #1

    How much expensive openning and closing connection is when connection pool is used ??? Assume I invoke four stored procedures in a page , I open and close the connection for invoking each . How much will it affect the performance of that page ?? calling this in a page : Connection.Open(); //Invoke the stored procedure n1 Connection.Close(); Connection.Open(); //Invoke the stored procedure n2 Connection.Close(); Connection.Open(); //Invoke the stored procedure n3 Connection.Close(); Connection.Open(); //Invoke the stored procedure n4 Connection.Close(); Is it worth replacing it with this. I have made the site like above.It is so hard for me to replace that. What is your suggestion ? Connection.Open(); //Invoke the stored procedure n1 //Invoke the stored procedure n2 //Invoke the stored procedure n3 //Invoke the stored procedure n4 Connection.Close();

    Best regards Hossein Yahoo ID :hosseinnick

    N 1 Reply Last reply
    0
    • D devboycpp

      How much expensive openning and closing connection is when connection pool is used ??? Assume I invoke four stored procedures in a page , I open and close the connection for invoking each . How much will it affect the performance of that page ?? calling this in a page : Connection.Open(); //Invoke the stored procedure n1 Connection.Close(); Connection.Open(); //Invoke the stored procedure n2 Connection.Close(); Connection.Open(); //Invoke the stored procedure n3 Connection.Close(); Connection.Open(); //Invoke the stored procedure n4 Connection.Close(); Is it worth replacing it with this. I have made the site like above.It is so hard for me to replace that. What is your suggestion ? Connection.Open(); //Invoke the stored procedure n1 //Invoke the stored procedure n2 //Invoke the stored procedure n3 //Invoke the stored procedure n4 Connection.Close();

      Best regards Hossein Yahoo ID :hosseinnick

      N Offline
      N Offline
      nguyenvhn
      wrote on last edited by
      #2

      I think the first way is acceptable. The close method returns connection to the pool and open method get a freely connection from pool. The second way seems to be a bit better performance but it will charge a lots of cost of changing sources

      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