@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)
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
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