Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

@LongOp

Hello,
Whenever I call IWorkspaceConnection.refresh(), I get the following
exception stating 'Long-running operations prohibited on this thread'.
How should such api/operations be invoked, in which threads?
Regards,
Sri.


java.lang.IllegalStateException: Long-running operations prohibited on
this thread
at
com.ibm.team.repository.client.util.ThreadCheck.checkLongOpsAllowed(ThreadCheck.java:117)
at com.ibm.team.scm.client.ContextLock.acquire(ContextLock.java:364)
at
com.ibm.team.scm.client.internal.WorkspaceConnection.refresh(WorkspaceConnection.java:853)
at
com.ibm.team.scm.client.internal.WorkspaceConnection.refresh(WorkspaceConnection.java:832)

0 votes



One answer

Permanent link
Whenever I call IWorkspaceConnection.refresh(), I get the following
exception stating 'Long-running operations prohibited on this thread'.
How should such api/operations be invoked, in which threads?

Operations that access the server should always be run in a background
thread. Executing them in the UI thread or in an event notification
thread will log the exception that you mention above, because these
operations may block the thread for an extended period of time (freezing
the UI).

You can use the Job class for that or take a look at some more
specialized Job sub-classes that we use in Jazz:

com.ibm.team.jface.util.UIUpdaterJob
com.ibm.team.foundation.client.util.FoundationJob

HTH,
Patrick
Jazz Work Item Team

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,952

Question asked: May 12 '08, 12:10 a.m.

Question was seen: 8,711 times

Last updated: May 12 '08, 12:10 a.m.

Confirmation Cancel Confirm