How can we programmatically confirm a connection to RTC is available?
RachitKumar Chirania (11●1●1)
| asked Jul 23 '13, 6:25 a.m.
edited Jul 24 '13, 3:44 p.m. by Millard Ellingsworth (2.5k●1●24●31) 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
Ralph Schoon (63.6k●3●36●47)
| answered Jul 25 '13, 8:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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/
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
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.
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.
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 ??