Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to serialize the programmatically comment insertion?

 We have a Plain Java Client to programmatically add comments to existing work-items.
The snippet of code we use is:
ITeamRepository repo = ...
String msg = ...
WorkItemWorkingCopy workingCopy = ...
IWorkItem wiFreshCopy = workingCopy.getWorkItem();
IComments comments = wiFreshCopy.getComments();
IComment comment = comments.createComment(repo.loggedInContributor(), XMLString.createFromPlainText(msg));
comments.append(comment);
workingCopy.save(null);
When two (or more) processes try to add a new comment to the same work-item at the same time, only the last comment will be included.
How can we serialize the comment insertion? Why using a working copy is not enough?
Thanks in advance.
Cheers.

0 votes



One answer

Permanent link
We have tried to add the condition:
while (workingCopy.isDirty());
	
before add a new comment, but obviosly it is not enough...

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jul 12 '12, 4:23 a.m.

Question was seen: 4,070 times

Last updated: Oct 05 '12, 10:33 a.m.

Confirmation Cancel Confirm