RTC API add/remove user corupts team area
I have a straightforward code to manipulate members in a team are:
IContributorManager conManager = repo.contributorManager(); IContributor contributor = conManager.fetchContributorByUserId(uid, new NullProgressMonitor()); IProcessItemService itemService = (IProcessItemService) repo.getClientLibrary(IProcessItemService.class); List<IProjectArea> areas = itemService.findAllProjectAreas(null, null); for (IProjectArea projectArea : areas) { IProjectArea mutableProjectCopy = (IProjectArea) itemService.getMutableCopy(projectArea); if ("some logic") { The code works for most of the time, but time-to-time the project area is corrupted, showing an exception below in the project view. Does my code need any kind of synchronization/transaction etc.? com.ibm.team.repository.service.internal.RepositoryItemService.doFetchItem(RepositoryItemService.java:575) com.ibm.team.repository.service.internal.RepositoryItemService.access$4(RepositoryItemService.java:568) com.ibm.team.repository.service.internal.RepositoryItemService$5.run(RepositoryItemService.java:548) com.ibm.team.repository.service.internal.rdb.RepositoryDatabase$Transaction.run(RepositoryDatabase.java:567) com.ibm.team.repository.service.internal.rdb.RepositoryDatabase$1.run(RepositoryDatabase.java:342) com.ibm.team.repository.service.internal.rdb.ConnectionPoolService.withNewDeferredConnection(ConnectionPoolService.java:545) com.ibm.team.repository.service.internal.rdb.ConnectionPoolService.withCurrentDeferredConnection(ConnectionPoolService.java:563) sun.reflect.GeneratedMethodAccessor228.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) java.lang.reflect.Method.invoke(Method.java:611) org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361) org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347) org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56) com.sun.proxy.$Proxy143.withCurrentDeferredConnection(Unknown Source) com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runTransaction(RepositoryDatabase.java:339) |
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Oct 24 '16, 4:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I use the same code in https://rsjazz.wordpress.com/2013/09/18/deploying-templates-and-creating-projects-using-the-plain-java-clients-library/ and I have never experienced an issue with it so far.
|
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.