Welcome to the Jazz Community Forum
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?
One answer

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.
Comments
Tim Mok
JAZZ DEVELOPER Jul 24 '13, 4:39 p.m.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
RachitKumar Chirania
Jul 25 '13, 7:59 a.m.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;}
RachitKumar Chirania
Jul 25 '13, 8:00 a.m.is there any alternate way to do this ??