I have a data provider. Is it thread-safe to use client specific instance variables in it? Is it that a new instance of my data provider is created for each new client? If one client fires up 2 instances of IE and logs in as the same client, 2 instances of my data provider are created to serve the requests If the client closes one browser, one of the 2 instances of my data provider is gced . if he closes both browsers, then both instances of my dp are gced right?
Only one instance of your Data Provider is created and it is used for all the lifecycle of the Server. That means that such instance will be shared for all the requests. Also notice that the Data Provider has no notion of users. It's the Metadata Adapter that can know about each user's requests.