Changeset 4966
- Timestamp:
- 12/02/09 17:36:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/xmlrpcclient.py
r4922 r4966 8 8 import dbconstants as dc 9 9 from xml.etree import cElementTree as ET 10 from ndg.common.src.lib.ETxmlView import et2text11 10 from ndg.common.src.clients.xmldb.interfacexmldbclient import InterfaceXMLDBClient 12 11 … … 25 24 @keyword port: Port to access DB on. Default, '8080' 26 25 ''' 27 logging.debug(" Setting up xmlrpc connection to eXist")26 logging.debug("Initialising XMLRPCClient") 28 27 self.xmlrpc = self.__getXMLRPCConnection(host, userID, pw, 29 28 basePath, xmlrpcBasePath, port) 30 logging.debug("X ml-rpc connection to eXist set up")29 logging.debug("XMLRPCClient initialised") 31 30 32 31 … … 98 97 # set to arbitrary big number 99 98 noResults = 100000 100 return self.__executeChunkedQuery(xquery, offset, noResults, params) 99 100 result = None 101 attempt = 0 102 while not result: 103 try: 104 result = self.__executeChunkedQuery(xquery, offset, 105 noResults, params) 106 except xmlrpclib.Fault, f: 107 if attempt < 3: 108 attempt += 1 109 logging.error("XMLRPCLib Fault caught - retrying xquery (attempt %s)" %attempt) 110 continue 111 else: 112 logging.error("Retry limit exceeded - giving up") 113 raise f 101 114 102 115 id, summary = self.__executeQuery(xquery, params) … … 147 160 results=[] 148 161 for el in x.getchildren(): 149 results.append( et2text(el))162 results.append(ET.tostring(el)) 150 163 151 164 logging.debug("XQuery executed")
Note: See TracChangeset
for help on using the changeset viewer.