It's all about the answers!

Ask a question

Using RTC Plain Java API, how long can TeamPlatform be in started state?


0
1
Michael Plautz (26711) | asked Feb 20 '15, 8:37 p.m.
 I am throwing together a small web application that leverages the RTC Plain Java API to help with some automation. This will only ever be used by a handful of people, and likely not more than a few at one time. I have noticed when I connect to the repository via the client, it takes ... a moment. I bring this up because if I am to go between pages of this web application, I don't want to have to startup, connect, and run a query each time, then shtudown. So my approach will be for the user to login the the app, open a repository connection then, and keep the connection open for X minutes on the backend while the user goes between pages, just so I don't have to keep opening and closing the connection on the backend every time the user goes between pages.

So here's my question: Regarding the code:

TeamPlatform.startup()
try {
    // Code here
}
finally {
    TeamPlatform.shutdown()
}

How long can the TeamPlatform be in the "started" state? Can I startup when my web application starts and shutdown when my web application stops? (This would mean it is in the "started" state for weeks or months) Or is that too long? Should I only have it in the "started" state while I anticipate users being logged in? (As in, if the first user is logging in, start it up, and after X minutes, if I log that user out and no user is logged in anymore, shut it down till the next user attempt to login?)

Comments
Michael Plautz commented Feb 21 '15, 10:31 a.m.

 I would like to clarify my post a bit. I know that after you call TeamPlatform.startup() is when you actually log in. I have that part taken care of. That is what is represented by my "// Code here" part above. I am not as concerned about timeouts with connections. That's why I specifically will auto-log out people after X minutes. What I am specifically asking is is it okay to call TeamPlatform.startup() and leave it in the "started" state indefinitely? (And call shutdown() when my web app shuts down on tomcat.)


sam detweiler commented Feb 21 '15, 12:33 p.m.

far as I know, this only creates some data objects and has no connection info of any kind. I never considered this an issue.


Michael Plautz commented Feb 21 '15, 11:22 p.m.

Excellent, thanks Sam (@sdetweil) that is what I was hoping to figure out. The API documentation was not clear on this, so I wanted to make sure this was okay. If you go back to your answer and amend what you said in your follow up comment, I will mark yours as the right answer. 

Accepted answer


permanent link
Ralph Schoon (63.1k33645) | answered Feb 23 '15, 2:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please see : https://rsjazz.wordpress.com/2013/07/15/boost-your-automation-performance-using-an-automation-server/

As far as I know you can keep the team platform started as long as you want to. This saves 6-8 seconds.

You can then quickly login and perform what you need to do.
Michael Plautz selected this answer as the correct answer

One other answer



permanent link
sam detweiler (12.5k6195201) | answered Feb 21 '15, 8:26 a.m.
its not startup, its connection timeout.

use the setconnectiontimeout method

            ITeamRepository srcServer = TeamPlatform.getTeamRepositoryService().getTeamRepository(url);
            // and set the connection timeout, has to be set before login
            Server.setConnectionTimeout(master_connection_timeout);
            // login, will throw error if not authorized
            Server.login(null);

in my code I then catch the exception, and logout/login again, increasing the timeout.
catch (Exception ex)
                                {
                                    if (ex.getMessage().contains("error occurred: \"java.net.SocketTimeoutException\""))
                                }

this value is total elapsed time, not per transaction.

Comments
Michael Plautz commented Feb 21 '15, 10:34 a.m.

This is helpful information, and will help me with my web app, but please see my amended comment to my post clarifying the information that I am actually after.

Your answer


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