It's all about the answers!

Ask a question

RTC Plain Java API is throwing Stale Data

Shwetha G (112) | asked May 29 '23, 12:35 a.m.
edited May 29 '23, 9:12 a.m.

 Hi Team,

We are trying to resolve the workitem through RTC Plain Java API, but the code throws MultiStaleDataException. 
Please help us with the code snippet to refresh the workitem and resolve it (OR) What is the procedure to resolve this exception ? Please share the code snippet. 

Exception StackTrace: Stale Data

Following is code snippet throwing the exception:, null);

Thanks in advance.

One answer

permanent link
Sudarshan M (107121) | answered May 30 '23, 12:54 a.m.

 I think the exception is being caused because the work item you are referencing has already been updated from a previous change and you are still referencing the old work item.
So let's say you are updating multiple attributes but each independently. The pseudo-code would be something like this ...

get work item handle
get working copy
edit attribute 1
save working copy

get fresh copy of work item
get working copy
edit attribute 2
save working copy

get fresh copy of work item

Shwetha G commented May 30 '23, 2:05 a.m.

 @Sudharshan M

How to get the fresh working copy of the workitem ?

 IWorkItem workItem = workItemClient.findWorkItemById(workItem1.getId(), IWorkItem.FULL_PROFILE, null);

is not working. Still throwing the same error. Thanks

Your answer

Register or to post 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.