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

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

 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?)

1

0 votes

Comments

 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.)

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

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

0 votes


One other answer

Permanent link
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.

1 vote

Comments

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

Question asked: Feb 20 '15, 8:37 p.m.

Question was seen: 5,117 times

Last updated: Feb 23 '15, 2:30 a.m.

Confirmation Cancel Confirm