IProcessClientService.findProcessArea returns null unexpectedly
I have a tomcat webapp which queries RTC on behalf of the user making the request to the web service. The name of the project area specified in the findProcessArea call is fixed in a configuration attribute (and so is the same a cross all users).
The actual credentials passed are specific to each user.
What I am finding is that after some time a certain user will not be able to retreive the project area becuase the IProcessClientService.findProcessArea call retrurns null. If I restart the server this user will then be able to access the process area and everything will continue as normal until at some point another user will enocunter the problem.
Is there any kind of caching going on in the client libraries that could be explaining what I am seeing here?
One answer
If a project area is returned from the server, the client library may cache the item locally. But it doesn't cache a null value. If you're getting back null from the client library, that's what came back from the server.
I'm less sure about the underlying team repository object, though. Are you using the same one to make requests for different users? I don't know for a fact whether that would break, but I don't believe that's how it was designed to be used.
In general, what you're describing here doesn't make sense to me. Especially the part about restarting the server... I've never heard of anything like that. If you can reproduce the problem with a sequence of calls, I'd open a defect.
Comments
Hi Jared,
I think it should be a new team repository for each user, basically I do this:
teamRepository = TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryURI);
teamRepository.registerLoginHandler(new RTCLogin(userId, password));
Where RTCLogin is a very simple wrapper for the username / pwd. Certainly the intention is to be using a different one for each request and certainly for each user.
I can't reproduce this at will, after a few days of usage a particular user will get into this state but I can't predict in advance when it will happen.
I would use TeamPlatform.getTeamRepositoryService().getUnmanagedRepository(repositoryURI) instead. Otherwise, you are getting back a shared instance which could already be logged in as another user. With an unmanaged instance, you should get a fresh one every time.