Asp.net static object behaviour
<p>I have the following class as part  of an asp.net application.</p>

<pre><code>public sealed class SomeClass    
 {
    private static string appId = Guid.NewGuid().ToString();

    public static ReadSomethingFromDb(){}

    public static WriteSomethingToDb(){}
}
</code></pre>

<p>There are more than one application instances in the same application pool, and they all access the same database. I want the operations performed by the above class to be uniquely tied to the instance that performed it, hence the use of the appId. So adding a record to the database would for example contain a name, address and appId. This has been simplified for discussion purposes.</p>

<p>Assuming that I have two instances running at mysite.a and mysite.b the above class would generate two different guids.</p>

<p>My problem is that mysite.a sometimes produces more than one guid, which is unexpected.</p>

<p>Thank you in advance</p>
