How can I make my thread to allow Long-running operations?
![]()
Please help.
I was getting the following exception. What should I do to make my thread acceptable by ThreadCheck's checkLongOpsAllowed method. Thanks, Weiping ========================================================== java.lang.IllegalStateException: Long-running operations prohibited on this thread at com.ibm.team.repository.client.util.ThreadCheck.checkLongOpsAllowed(ThreadCheck.java:115) at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.invoke(ServiceInterfaceProxy.java:78) at $Proxy9.save(Unknown Source) at com.ibm.rmc.jazz.uma.convert.impl.UmaAdaptorMgrImpl03$1.visit(UmaAdaptorMgrImpl03.java:338) at com.ibm.rmc.jazz.uma.convert.impl.RmcJazzObjectMgr.visitedBy(RmcJazzObjectMgr.java:69) at com.ibm.rmc.jazz.uma.convert.impl.UmaAdaptorMgrImpl03$2.run(UmaAdaptorMgrImpl03.java:353) at java.lang.Thread.run(Thread.java:801) at com.ibm.rmc.jazz.uma.convert.impl.UmaAdaptorMgrImpl03.saveMethodLibrary(UmaAdaptorMgrImpl03.java:361) at com.ibm.rmc.jazz.uma.library.JazzResourceSetImpl.save(JazzResourceSetImpl.java:53) at |
Accepted answer
![]()
Typically this exception indicates that you are on the UI thread. It is
trying to warn you that calling a long running operation (like making a network call) on the UI thread will lock up the UI. Try using a org.eclipse.core.runtime.jobs.Job to put your network call on a non-UI thread. It would look something like this: Job job = new Job("my job") { protected abstract IStatus run(IProgressMonitor monitor) { // your longop call here } }; job.schedule(); // start the job wlu wrote: Please help. Ralph Schoon selected this answer as the correct answer
|
5 other answers
![]()
You may also want to take a look at
com.ibm.team.jface.util.UIUpdaterJob which allows you to easily split your work in a long-running background part and a short-running UI part. --Patrick |
![]()
For using com.ibm.team.jface.util.UIUpdaterJob, where the com.ibm.team.jface.util package is located? I could not find it under the 1.0Beta2 client/source codes.
|
![]()
wlu schrieb:
For using com.ibm.team.jface.util.UIUpdaterJob, where the It's plugin com.ibm.team.jface. Cheers, Toby |
![]()
What are the differences between "com.ibm.team.jface.util.UIUpdaterJob" and "com.ibm.team.foundation.client.util.FoundationJob"?
|