Changeset 2685


Ignore:
Timestamp:
01/11/12 02:23:05 (4 months ago)
Author:
joni
Message:

enhancement: oracle now attempts a few times if timed out on connection, bad ini files also show absolute full path

Location:
simo/trunk/src/simo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simo/trunk/src/simo/db/datadb/db.py

    r2683 r2685  
    460460    def open(self): 
    461461        self.opened = True 
    462         self.conn = cx_Oracle.connect(self.c_str, threaded=self.threaded) 
     462        for i in range(5): 
     463            try: 
     464                self.conn = cx_Oracle.connect(self.c_str, threaded=self.threaded) 
     465                break 
     466            except cx_Oracle.DatabaseError, e: 
     467                if 'Connect timeout' in str(e) and i < 4: 
     468                    self.logger.log_message('db', 'warning',  
     469                        'Connection timed out, retrying %d of %d' % (i+1, 4)) 
     470                else: 
     471                    raise 
    463472        self.conn.autocommit = False 
    464473 
  • simo/trunk/src/simo/utils/runnerconfig.py

    r2667 r2685  
    171171                            % (option,folder) 
    172172                else: 
    173                     err_msg = 'Option %s: invalid path %s' % (option,folder) 
     173                    err_msg = 'Option %s: invalid path %s (%s)' % (option, 
     174                                                                   full_path, 
     175                                                                   folder) 
    174176                self._set_error(err_msg) 
    175177            elif setbase: 
     
    231233            valid = True 
    232234        if not valid: 
    233             self._set_error("Option %s: directory %s "\ 
    234                              "doesn't exist" % (option, folder)) 
     235            self._set_error("Option %s: directory %s (%s) "\ 
     236                             "doesn't exist" % (option, fpath, folder)) 
    235237 
    236238    def _check_integer(self, option): 
Note: See TracChangeset for help on using the changeset viewer.