Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

How can we programmatically confirm a connection to RTC is available?

I logged in to RTC repository and sucessfully connnected ot RTC.I got my teamRepositoryObject as well.Even connection to RTC repository not available, the teamRepository method "isLoggedIn" is giving value as "true" through Jazz RTC API's.

Could any one suggest that how will check the whether connection to RTC is available or not periodically?

0 votes

Comments

What kind of error do you get when you try to use the repository connection? If your logged in check passes, the connection should be good. Maybe you can try adding a listener to the repository connection to see if the connection drops at any point you try to use it.

Also, a code sample may also help determine if something in between your check and use is causing some kind of instability with the connection.

1 vote

See Initially I have connected successfully  to RTC Repository.My code is working fine.But suppose connection drops at any point during my code flow, how come i will know whether connection exists or not.

For that I have created one method name "checkRTCConnection" In which I am sending a simple request to server and if exception occurs it means Connection does not exist.

Below is the code :
public boolean checkRTCConnection() {boolean isRTCConnectionExist = true;
try{long attachmentSize = getWorkItemClient().fetchMaxAttachmentSize(null);}catch(Exception e){isRTCConnectionExist = false;}

is there any alternate way to do this ??



One answer

Permanent link
I use the code from https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation in the Plain Java API section for years now and I have never seen any issue. Please provide your code so that we can understand what the issue is. You might also want to look into http://rsjazz.wordpress.com/2013/07/15/boost-your-automation-performance-using-an-automation-server/

0 votes

Comments

Opposite to what you describe my connection does never drop.I think you might want to look at network level. Maybe your infrastructure drops the connection if they are idle for some reason. If you experience what you say with Plain Java, you should intermittently loose connection with the Eclipse client too. You would have to  log out and log back in, because the client does not expect to loose the connection.

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,994

Question asked: Jul 23 '13, 6:25 a.m.

Question was seen: 5,523 times

Last updated: Jul 25 '13, 8:10 a.m.

Confirmation Cancel Confirm