|
Posted by Erland Sommarskog on 03/28/07 22:41
DaveP (dvs_bis@sbcglobal.net) writes:
> im writing a service that will be on a app server
> this is one of many service's to process Recordsets from Sql Server...
> 1 service may have 20 Processes to Complete
> example
> main class PreProcess()
> method CleanNames();
> method updateNames();
> methodr ValidateContracts();
> Various things must be completed
> Suedo Example below
> My question is
> in the main class make my connection and keep it for all sub members
> or connect in each member
I'm not really sure I understand, but if the members are intended to
be separate threads, you should definitely have one connection per
member.
If they are just different tasks that a single-threaded service will
perform, it's more of a toss-up, but I think the idiom today is to stick
with local connections. Keep in mind that ADO .Net maintains a connection
pool where it lingers to disconnected connections and then reuse them
if there is a request for a connect with the same properties within
some timefram (60 seconds, I believe).
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|