How to call service at logout without getting an exception?
Hello,
I have registered login participant to get notified when the user has logged out. Upon logout, I need to call into my service on the server to do cleanup. This has worked great until M6a. After migrating to RC4, I found that the login participant is being called on the UI thread. When I made the call to the service to do clean up, I got the following exception: java.lang.IllegalStateException: Long-running operations prohibited on this thread at com.ibm.team.repository.client.util.ThreadCheck.checkLongOpsAllowed(ThreadCheck.java:117) at Since the user is logging out, I am not able to schedule a background job to do my task. By the time my job is run, the user may have already logged out, and I am no longer able to call my service. Is there a reason why the login participant is called on the UI thread? Is there a way to do this clean up without getting into this exception? Can I get notified that a user is logged out on the server side? Thanks... Samantha |
One answer
Samantha, I would avoid using the login participant for the purpose of UI and server clean up. The API was there before we introduced eventing on the client and should have been deprecated. I recommend using a listener on the ITeamRepository.STATE property.
Doing clean up on the server as a result of a logout, won't be helpful as it would not take care of cases where someone exits eclipse without logout or when the client machine crashes. Having used Team Concert for the past 2 years, I rarely logout. Do you mind if I ask what kind of clean up are you doing on the server? |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.