SOConnection Best Practice?

  • 14 July 2010
  • 1 reply

Badge +2

Can anyone recommend the best practice for using SOConnection ?

With SqlConnection it is recommended that we create it whenever we need and ODBC/.NET takes care of the connection pooling.

For example in a web page that interacts with K2 should we reuse a single SOConnection for the page request lifetime or like .NET recreate the connection just before each commend is being executed?

1 reply

Badge +9

From what I understand, there isn't any specific connection pooling implemented in the base API for 4.5.  It is still recommended to reuse the connection object.  You can refer to the best practices guide  There is a section on handling connections.

One thing to note for 4.5, there is a key enhancement called object caching.  SO object definitions are cached on the connection level after the initial call, so repeated calls for GetSmartObject will return instantaneously.