I have several service classes that have static methods and offer a service to the rest of my program. Most of these services involve accessing an instance of SqlDataContext (linq2sql).
First I tried instantiating this connection as a static private member per service class. This works, but it also generates a bunch of lock ups, delays and dirty object problems.
Now I went with a private instance that gets instantiated at method level. This works better in terms of lock ups and problems with dirty objects because the scope is smaller and more predictable, but this also generates a bunch of overhead in terms of connection handshakes.
How do you suggest to take on this problem?