<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Paul,
<div class=""><br class="">
</div>
<div class="">
<div class=""> You can enable the keepAlive on the client object with</div>
<div class="">conn.c.enableKeepAlive(300)</div>
<div class="">See 5.2 docs: <a href="https://downloads.openmicroscopy.org/omero/5.2.0/api/omero/client.html#enableKeepAlive-int-" class="">
https://downloads.openmicroscopy.org/omero/5.2.0/api/omero/client.html#enableKeepAlive-int-</a> </div>
<div class=""><br class="">
</div>
<div class="">Also you can set this in the etc/omero.properties file.</div>
<div class="">See discussion at <a href="https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=495" class="">
https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=495</a>  </div>
</div>
<div class=""><br class="">
</div>
<div class="">Hope that helps,</div>
<div class=""><br class="">
</div>
<div class="">  Will.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><font face="Arial" class=""><span style="font-size: 15px; white-space: pre-wrap;" class=""><br class="">
</span></font>
<div>
<blockquote type="cite" class="">
<div class="">On 24 Apr 2017, at 09:44, Paul Korir <<a href="mailto:pkorir@ebi.ac.uk" class="">pkorir@ebi.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Dear OMERO Users/Developers,<br class="">
<br class="">
I'm writing a client application which connects to an OMERO server through a BlitzGateway object but I get a lost-connection exception. Could someone please advise me on how to keep a connection open? The snippet of code is roughly the following:<br class="">
<br class="">
conn = omero.gateway.BlitzGateway(...)<br class="">
roi = <some large ROI object><br class="">
conn.getUpdateService().saveObject(roi)<br class="">
<br class="">
Please see the traceback below:<br class="">
<br class="">
Traceback (most recent call last):<br class="">
 File "/Users/pkorir/omero/OMERO.server/lib/python/omero/gateway/__init__.py", line 4212, in __call__<br class="">
   return self.f(*args, **kwargs)<br class="">
 File "/Users/pkorir/omero/OMERO.server/lib/python/omero_api_IUpdate_ice.py", line 131, in saveAndReturnObject<br class="">
   return _M_omero.api.IUpdate._op_saveAndReturnObject.invoke(self, ((obj, ), _ctx))<br class="">
ConnectionLostException: Ice.ConnectionLostException:<br class="">
Broken pipe<br class="">
Fri Apr 21 17:02:55 2017    Closing the connection...<br class="">
Fri Apr 21 17:02:55 2017    Deleting ROIHandler instance... OK<br class="">
WARNING:omero.client:Cannot get session service for killSession. Using closeSession<br class="">
Fri Apr 21 17:02:55 2017    Connection closed.<br class="">
Traceback (most recent call last):<br class="">
 File "/Users/pkorir/VirtualEnvs/sfftk/bin/sffp", line 11, in <module><br class="">
   load_entry_point('sfftk-plus', 'console_scripts', 'sffp')()<br class="">
 File "/Users/pkorir/Documents/workspace/bioimaging-scripts/trunk/sfftk-plus/sfftkplus/sffplus.py", line 460, in main<br class="">
   return handle_attachroi(args)<br class="">
 File "/Users/pkorir/Documents/workspace/bioimaging-scripts/trunk/sfftk-plus/sfftkplus/sffplus.py", line 381, in handle_attachroi<br class="">
   omero_connection.saveRoi(roi)<br class="">
 File "/Users/pkorir/Documents/workspace/bioimaging-scripts/trunk/sfftk-plus/sfftkplus/omero/handlers.py", line 149, in saveRoi<br class="">
   self.conn.getUpdateService().saveAndReturnObject(roi)<br class="">
 File "/Users/pkorir/omero/OMERO.server/lib/python/omero/gateway/__init__.py", line 4215, in __call__<br class="">
   return self.handle_exception(e, *args, **kwargs)<br class="">
 File "/Users/pkorir/omero/OMERO.server/lib/python/omero/gateway/__init__.py", line 4212, in __call__<br class="">
   return self.f(*args, **kwargs)<br class="">
 File "/Users/pkorir/omero/OMERO.server/lib/python/omero_api_IUpdate_ice.py", line 131, in saveAndReturnObject<br class="">
   return _M_omero.api.IUpdate._op_saveAndReturnObject.invoke(self, ((obj, ), _ctx))<br class="">
Ice.ConnectionLostException: Ice.ConnectionLostException:<br class="">
Broken pipe<br class="">
<br class="">
-- <br class="">
Paul K. Korir, PhD<br class="">
Scientific Programmer<br class="">
EMBL-EBI<br class="">
01223494422<br class="">
<br class="">
_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>