It's all about the answers!

Ask a question

RTC API add/remove user corupts team area

Kamil Jezek (463) | asked Oct 21 '16, 8:46 a.m.
edited Oct 21 '16, 8:51 a.m.
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") {
 } else {
 // similar code omitted here for add/remove administrator IProjectArea[] {mutableProjectCopy}, null);

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.?

The following record was not found in the database: (stateId: , itemId: [UUID _8lNyYNwSEd2pIJ5QVwgQGg], origin: null, immutable: )ID CRJAZ0215E$4($$$ sun.reflect.GeneratedMethodAccessor228.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke( java.lang.reflect.Method.invoke( org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke( org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0( org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke( com.sun.proxy.$Proxy143.withCurrentDeferredConnection(Unknown Source)

One answer

permanent link
Ralph Schoon (59.0k23642) | answered Oct 24 '16, 4:59 a.m.
I use the same code in and I have never experienced an issue with it so far.

Your answer

Register or to post your answer.