Connection Pooling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dragon

    #1

    Connection Pooling

    By default, DB Connection is pooling ? (SqlConnection, OdbcConnection)
    Or I have to write my own Connection Pooling class ?


  • Arran Pearce

    #2
    Re: Connection Pooling

    Yes if you are using SqlConnection then by default its pooled with a pool
    size of 100. To change the setting edit the connection string.


    "Dragon" <taw3004@hotmai l.com> wrote in message
    news:eDYulXBPGH A.1312@TK2MSFTN GP09.phx.gbl...[color=blue]
    > By default, DB Connection is pooling ? (SqlConnection, OdbcConnection)
    > Or I have to write my own Connection Pooling class ?
    >[/color]


    Comment

    • Dragon

      #3
      Re: Connection Pooling

      if there are 100 Connection Pooling
      So, does it mean that,
      at the time I call Connection.Clos e()
      the system will mark its and idle and assign to other Connection.Open ()
      rather then really close the Connection and kill the object ?
      Then, I should call Connection.Clos e() after I have finish Execute the
      Command?


      "Arran Pearce" <arranpearce@ce llhire.com> wrote in message
      news:OZvqleEPGH A.2268@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Yes if you are using SqlConnection then by default its pooled with a pool
      > size of 100. To change the setting edit the connection string.
      >
      >
      > "Dragon" <taw3004@hotmai l.com> wrote in message
      > news:eDYulXBPGH A.1312@TK2MSFTN GP09.phx.gbl...[color=green]
      >> By default, DB Connection is pooling ? (SqlConnection, OdbcConnection)
      >> Or I have to write my own Connection Pooling class ?
      >>[/color]
      >
      >[/color]


      Comment

      • Miha Markic [MVP C#]

        #4
        Re: Connection Pooling


        "Dragon" <taw3004@hotmai l.com> wrote in message
        news:e$%23SC0EP GHA.3276@TK2MSF TNGP09.phx.gbl. ..[color=blue]
        > if there are 100 Connection Pooling
        > So, does it mean that,
        > at the time I call Connection.Clos e()
        > the system will mark its and idle and assign to other Connection.Open ()
        > rather then really close the Connection and kill the object ?[/color]

        That's the idea.
        [color=blue]
        > Then, I should call Connection.Clos e() after I have finish Execute the
        > Command?[/color]

        The general idea is to Open as late as possible and Close as soon as
        possible.

        --
        Miha Markic [MVP C#]
        RightHand .NET consulting & development www.rthand.com
        Blog: http://cs.rthand.com/blogs/blog_with_righthand/


        Comment

        Working...