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

Which handle do i disconnect??

 Here is some simple client which i'm uusing to create Workitems


       IWorkItemClient wiClient = .... 
       IWorkItemType workItemType = wiClient.findWorkItemType(oProject, "com.abd.type1", null);
       IWorkItemWorkingCopyManager wiwcmgr = ....
IWorkItemHandle workItemHandle = wiwcmgr.connectNew(workItemType, null);
WorkItemWorkingCopy workingCopy = wiwcmgr.getWorkingCopy(workItemHandle);
IWorkItem wiWorkingCopy = workingCopy.getWorkItem(); wiWorkingCopy.setHTMLSummary(XMLString.createFromPlainText("title1")); workingCopy.save(null);
wiwcmgr.disconnect(wiWorkingCopy);
It's not clear to me what I have to free up (disconnect) at the end. I was expecting that i would disconnect workItemHandle, as that is what i was given when i did the connect, however an examples i've seen disconnects using wiWorkingCopy. Can someone explain the subtleties please ? The code may need to create hundreds of items so i'm trying to avoid handle leakage in the client and the server

regards
john

0 votes



One answer

Permanent link

 I would suggest to not use that API and to follow https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ and use an workItemOperation as described in section Alternative to Create and Modify WorkItems


Other than that workItemHandle and workingCopy and wiWorkingCopy represent pretty much the same object just with different interfaces.

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
× 10,937

Question asked: Feb 01 '17, 11:04 a.m.

Question was seen: 2,117 times

Last updated: Feb 01 '17, 11:48 a.m.

Confirmation Cancel Confirm