From: Karsten H. <Kar...@gm...> - 2003-01-12 18:20:24
|
Hello ! We are using pypgsql in the medical practice management project GnuMed (www.gnumed.org). On task of GnuMed is to store documents relevant to patients. We have the following code retrieving document data from a bytea column: #------------------- # start our transaction (done implicitely by defining a cursor) cursor = aConn.cursor() # retrieve object cmd = "SELECT data FROM doc_obj WHERE oid='%s'" % (anObjID) try: cursor.execute(cmd) except: _log.LogException("cannot SELECT doc_obj", sys.exc_info()) return None # cDocument.metadata->objects->file name obj['file name'] = tempfile.mktemp() aFile = open(obj['file name'], 'wb+') # it would be a fatal error to see more than one result as oids are supposed to be unique aFile.write(str(cursor.fetchone()[0])) aFile.close() # close our connection cursor.close() #------------------- This works like a charm on Linux. On Win98SE, however, we get (consistent) errors one some documents. Those docs are large bitmaps, about 6 MB in size. pyPgSQL version: pypgsql-2-3.Win32.-py2.2.exe 13.12.02 Now, if you take a look at our log below you'll see the following error: OperationalError: could not receive data from server: No buffer space available (0x00002747/10055) Googling around a bit reveals that this error originates in the Windows Socket API and has to do with (who'd have thunk it) TCP transmit buffers. http://www.cit.cornell.edu/helpdesk/win/email/eud10055.html http://www-3.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/document.d2w/report?fn=db2tcp.htm http://msdn.microsoft.com/library/en-us/winsock/winsock/windows_sockets_error_codes_2.asp However, the only mention of a problem remotely sounding like ours on this mailing list is here: http://sourceforge.net/mailarchive/message.php?msg_id=1082358 I wonder if anyone can offer any insight, assure us it's a known bug on the TODO list (couldn't verify that myself), or point us to the odd registry setting we need to tweak. Regards, Karsten Hilbert, MD GnuMed i18n coordinator PS: Yes, that's a real patient. Now go sue me :-)) PPS: Here's the complete log: #=================================================================================================== 2003-01-12 16:15:23 ------------------------------------------------------------ 2003-01-12 16:15:23 [INFO] (.\modules\gmLog.py::__init__:357): SECURITY: initial log level is [INFO] 2003-01-12 16:15:23 [INFO] (.\modules\gmLog.py::SetAllLogLevels:241): SECURITY: log level change from [INFO] to [DATA] 2003-01-12 16:15:23 [DATA] (.\gmShowMedDocs.py::Main:28): $Revision: 1.4 $ 2003-01-12 16:15:23 [DATA] (.\modules\gmCLI.py::Main:125): $Revision: 1.8 $ 2003-01-12 16:15:23 [DATA] (.\modules\gmCLI.py::_preparse_cmdline:65): unparsed command line is >>.\gmShowMedDocs.py --conf-file=.\gnumed-archive.conf --text-domain=gnumed-archive<< 2003-01-12 16:15:23 [DATA] (.\modules\gmCLI.py::_parse_opts:118): command line arguments: {'--text-domain': 'gnumed-archive', '--conf-file': '.\\gnumed-archive.conf'} 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::Main:185): $Revision: 1.21 $ 2003-01-12 16:15:23 [INFO] (.\modules\gmI18N.py::install_domain:77): text domain is "gnumed-archive" 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:84): $(LANGUAGE) is not set 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:90): $(LC_ALL) is not set 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:96): $(LC_MESSAGES) is not set 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:100): $(LANG) is set to "de_DE@euro" 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:105): Searching message catalog file. 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:121): Looking behind environment variable $(GMSHOWMEDDOCS_DIR). 2003-01-12 16:15:23 [INFO] (.\modules\gmI18N.py::install_domain:136): Environment variable GMSHOWMEDDOCS_DIR is not set. 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:143): Looking in application level directory [C:\Programme\GNUmedArchive\locale]. 2003-01-12 16:15:23 [WARN] (.\modules\gmI18N.py::install_domain:154): The application level locale directory [C:\Programme\GNUmedArchive\locale] does not exist. Cannot install textdomain from there. 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:158): Looking in application level directory [C:\Programme\GNUmedArchive\client\locale]. 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::install_domain:163): Found message catalog. 2003-01-12 16:15:23 [DATA] (.\modules\gmI18N.py::Main:198): local time format set to "%Y-%m-%d %H:%M:%S" 2003-01-12 16:15:23 [DATA] (.\modules\gmCfg.py::Main:819): $Revision: 1.33 $ 2003-01-12 16:15:23 [DATA] (.\modules\gmCfg.py::__get_conf_name:546): (<aDir=None>, <aName=None>) 2003-01-12 16:15:23 [DATA] (.\modules\gmCfg.py::__get_conf_name:569): --conf-file=.\gnumed-archive.conf 2003-01-12 16:15:23 [DATA] (.\modules\gmCfg.py::__get_conf_name:572): Found config file [.\gnumed-archive.conf]. 2003-01-12 16:15:23 [DATA] (.\modules\gmCfg.py::__parse_conf_file:656): parsing config file [.\gnumed-archive.conf] 2003-01-12 16:15:24 [DATA] (.\modules\gmBackendListener.py::Main:112): $Revision: 1.5 $ 2003-01-12 16:15:24 [INFO] (.\modules\gmPG.py::Main:77): DBMS "Postgres" via DB-API module "<module 'pyPgSQL.PgSQL' from 'C:\PYTHON22\lib\site-packages\pyPgSQL\PgSQL.pyc'>": API level 2.0, thread safety 1, parameter style "pyformat" 2003-01-12 16:15:24 [DATA] (.\modules\gmPG.py::Main:572): $Revision: 1.29 $ 2003-01-12 16:15:25 [INFO] (.\gmShowMedDocs.py::Main:346): starting display handler 2003-01-12 16:15:25 [DATA] (.\modules\docDatabase.py::__init__:20): instantiating befund database connection object 2003-01-12 16:15:25 [DATA] (.\modules\gmPG.py::__connect:287): host:port=192.168.1.1:5432, db=gm-archive, user=papa, pw=??, opts=, tty= 2003-01-12 16:15:26 [INFO] (.\modules\docDatabase.py::connect:40): backend connection successfully established 2003-01-12 16:15:26 [DATA] (.\modules\gmPG.py::GetConnection:133): requesting RO connection to service [default] 2003-01-12 16:15:26 [DATA] (.\modules\docPatient.py::__load_from_xdt:100): found item [last name]: Pfizer 2003-01-12 16:15:26 [DATA] (.\modules\docPatient.py::__load_from_xdt:100): found item [first name]: Bernie 2003-01-12 16:15:26 [DATA] (.\modules\docPatient.py::__load_from_xdt:100): found item [date of birth]: 21011928 2003-01-12 16:15:26 [DATA] (.\modules\docPatient.py::__load_from_xdt:100): found item [gender]: 2 2003-01-12 16:15:26 [DATA] (.\modules\docPatient.py::__load_from_xdt:132): Bernie Pfizer (f), 19280121 (DE) 2003-01-12 16:15:26 [INFO] (.\modules\docPatient.py::getIDfromGNUmed:210): getting patient ID from GNUmed compatible database 2003-01-12 16:15:26 [DATA] (.\modules\docPatient.py::getIDfromGNUmed:227): matching patient ID(s): [[8]] 2003-01-12 16:15:26 [INFO] (.\gmShowMedDocs.py::__init__:99): Making document tree for patient with ID 8 2003-01-12 16:15:26 [INFO] (.\modules\docPatient.py::getDocsFromGNUmed:252): getting documents from GNUmed compatible database 2003-01-12 16:15:26 [DATA] (.\modules\docPatient.py::getDocsFromGNUmed:277): document IDs: [[1]] 2003-01-12 16:15:26 [DATA] (.\modules\docDocument.py::__init__:49): Instantiated. 2003-01-12 16:15:26 [INFO] (.\modules\docDocument.py::loadMetaDataFromGNUmed:143): loading stage 1 (document) metadata from GnuMed compatible database 2003-01-12 16:15:26 [DATA] (.\modules\docDocument.py::loadMetaDataFromGNUmed:182): Meta data: {'comment': 'CT-Sch\xe4del', 'date': '2002-10-24', 'objects': {19648: {'comment': None, 'index': 1}}, 'reference': '3.20021201-143103', 'patient id': 8, 'type': 110, 'id': 1} 2003-01-12 16:15:30 [DATA] (.\gmShowMedDocs.py::OnActivate:205): User selected object 19648 from document 1 2003-01-12 16:15:30 [DATA] (.\gmShowMedDocs.py::OnActivate:210): working into directory 'c:\gmtmp\export' 2003-01-12 16:15:30 [DATA] (.\gmShowMedDocs.py::OnActivate:215): document: {'comment': 'CT-Sch\xe4del', 'date': '2002-10-24', 'objects': {19648: {'comment': None, 'index': 1}}, 'reference': '3.20021201-143103', 'patient id': 8, 'type': 110, 'id': 1} 2003-01-12 16:15:30 [INFO] (.\modules\docDocument.py::exportObjFromGNUmed:321): exporting object from GnuMed compatible database 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): cannot SELECT doc_obj 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): exception type : libpq.OperationalError 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): exception value: could not receive data from server: No buffer space available (0x00002747/10055) 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): Traceback (most recent call last):<#10-0x0A-lf> 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): File ".\modules\docDocument.py", line 351, in exportObjFromGNUmed<#10-0x0A-lf> cursor.execute(cmd)<#10-0x0A-lf> 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 2978, in execute<#10-0x0A-lf> self.__makedesc__()<#10-0x0A-lf> 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 2710, in __makedesc__<#10-0x0A-lf> _tn, _pl, _ia, _bt = _cache.getTypeInfo(_typ)<#10-0x0A-lf> 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 799, in getTypeInfo<#10-0x0A-lf> _res = self.__conn.conn.query("SELECT typname, -1 , typelem "<#10-0x0A-lf> 2003-01-12 16:15:38 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): OperationalError: could not receive data from server: No buffer space available (0x00002747/10055)<#10-0x0A-lf><#10-0x0A-lf> 2003-01-12 16:15:38 [ERROR] (.\gmShowMedDocs.py::OnActivate:219): Cannot export object (19648) data from database ! 2003-01-12 16:15:56 [DATA] (.\gmShowMedDocs.py::OnActivate:205): User selected object 19648 from document 1 2003-01-12 16:15:56 [DATA] (.\gmShowMedDocs.py::OnActivate:210): working into directory 'c:\gmtmp\export' 2003-01-12 16:15:56 [DATA] (.\gmShowMedDocs.py::OnActivate:215): document: {'comment': 'CT-Sch\xe4del', 'date': '2002-10-24', 'objects': {19648: {'comment': None, 'index': 1}}, 'reference': '3.20021201-143103', 'patient id': 8, 'type': 110, 'id': 1} 2003-01-12 16:15:56 [INFO] (.\modules\docDocument.py::exportObjFromGNUmed:321): exporting object from GnuMed compatible database 2003-01-12 16:15:56 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): cannot SELECT doc_obj 2003-01-12 16:15:56 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): exception type : libpq.OperationalError 2003-01-12 16:15:56 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): exception value: could not receive data from server: No buffer space available (0x00002747/10055) 2003-01-12 16:15:56 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): Traceback (most recent call last):<#10-0x0A-lf> 2003-01-12 16:15:56 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): File ".\modules\docDocument.py", line 351, in exportObjFromGNUmed<#10-0x0A-lf> cursor.execute(cmd)<#10-0x0A-lf> 2003-01-12 16:15:56 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 2951, in execute<#10-0x0A-lf> self.conn.conn.query('ROLLBACK WORK')<#10-0x0A-lf> 2003-01-12 16:15:56 [PANIC] (.\modules\docDocument.py::exportObjFromGNUmed:353): OperationalError: could not receive data from server: No buffer space available (0x00002747/10055)<#10-0x0A-lf><#10-0x0A-lf> 2003-01-12 16:15:56 [ERROR] (.\gmShowMedDocs.py::OnActivate:219): Cannot export object (19648) data from database ! 2003-01-12 16:16:07 [INFO] (.\modules\docDatabase.py::disconnect:54): releasing befund database connection 2003-01-12 16:16:07 [INFO] (.\gmShowMedDocs.py::Main:362): closing display handler -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 |