enableKeepAlive doesn't return anything. All it does it handle the setting of omero.keep_alive which you could also do via your configuration file (see etc/ice.config for an example). You can disable the keep alive again by choosing any value 0 or less. As well, when you call client.closeSession, the keep alive thread is stopped.
The optimal depends on your specific configuration, but the default is 10 minutes:
- Code: Select all
# from etc/omero.properties
omero.sessions.timeout=600000
If you choose a value half of this you should be safe. Choosing a value which is a third means that if one of the keep alives fail for network reasons, you can still recover. 3 minutes seems very reasonable then.
Cheers,
~Josh.
See also:
http://hudson.openmicroscopy.org.uk/job/OMERO/javadoc/epydoc/omero.clients.BaseClient-class.html#enableKeepAlive