Author Topic: SQL Connection and web service.  (Read 2742 times)

0 Members and 1 Guest are viewing this topic.

Draftek

  • Guest
SQL Connection and web service.
« on: October 16, 2008, 08:34:22 AM »
I'm creating a web service that to pass sql database info to and from a client application. Is it generally a better idea to make the connection object upon instantiation of the server object by the client application or inside each WebMethod?

This thing will only be hit by a half dozen people working on the same site as the server and the same off site through an internet connection so I'm not too worried about transaction conflicts, more so about performance because my testing of the web service sucks from that standpoint.

tjr

  • Guest
Re: SQL Connection and web service.
« Reply #1 on: October 16, 2008, 08:38:01 PM »
I'm creating a web service that to pass sql database info to and from a client application. Is it generally a better idea to make the connection object upon instantiation of the server object by the client application or inside each WebMethod?

This thing will only be hit by a half dozen people working on the same site as the server and the same off site through an internet connection so I'm not too worried about transaction conflicts, more so about performance because my testing of the web service sucks from that standpoint.
I did a google search for some .NET Cache stuff and it might help out. Especially search result 2.

Hitting the database every time for data is very very expensive. If you cache your results in memory you will gain quite a bit of speed.

Draftek

  • Guest
Re: SQL Connection and web service.
« Reply #2 on: October 17, 2008, 07:58:23 AM »
Thanks!

I'll take a look and see if it applies to my particular app.