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?)
Accepted answer
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.
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.
One other answer
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.
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
Feb 21 '15, 10:31 a.m.sam detweiler
Feb 21 '15, 12:33 p.m.Michael Plautz
Feb 21 '15, 11:22 p.m.