Page 1 of 1

How do I use the pooling features?

Posted: Wed 22 Jun 2011 21:46
by tabsautobiz
I'm currently creating a wcf service that will perform frequent selects on a database.

Currently I'm looking at something like this:

Code: Select all

Public Function GetInfo() as string
    Dim connection As New PgSqlConnection(connectionString)
    connection.Open()
    Dim command As New PgSqlCommand("SELECT * FROM TABLE", connection)
    Dim reader As PgSqlDataReader = command.ExecuteReader
    While reader.Read
      'do something with the data
    End While
    connection.Close()
    Return "Done"
End Function
Would this code transparently use the built-in connection pooling, or do I need to use a different approach?

Posted: Thu 23 Jun 2011 07:08
by Shalex
Usage of the connection pooling depends on the Pooling connection string parameter. The default value: Pooling=true.
For more information, please refer to http://www.devart.com/dotconnect/postgr ... Q.html#q54.