The program is being developed in Python. It contains lots of queries to a remote CouchDB database. The program begins to run and after a while, it is just freezes up. When I check the connection, I observe that the CouchDB database connection has been lost. It still uses the CPU without doing anything (it it seems so).
def addNewDnsRecord(self, record):
if self.checkHashValue(record['hashValue']):
.... #some code to generate an id
record['_id'] = tempid
self.bulk.append(record) #add record at the end of the bulk
if len(self.bulk) == 1000: #bulk with 1000 records are inserted
self.dns_db.update(self.bulk)
self.bulk = []
def checkHashValue(self, hashValue):
result = self.dns_db.view('records/hashcheck', None, key=hashValue)
if len(result) == 0:
return True
else:
return False
Secondly, is there a way to check whether connection is established or lost in CouchDB-python.
What may be the reason of connection loss?