It's all about the answers!

Ask a question

@LongOp


Srimanth Gunturi (206125) | asked May 12 '08, 12:10 a.m.
JAZZ DEVELOPER
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)

One answer



permanent link
Patrick Streule (4.9k21) | answered May 12 '08, 7:31 a.m.
JAZZ DEVELOPER
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

Your answer


Register or to post your answer.