server/sources/native.py
branchstable
changeset 9131 b3ad80aa645f
parent 9130 0f1504a9fb51
child 9267 24d9b86dfa54
equal deleted inserted replaced
9130:0f1504a9fb51 9131:b3ad80aa645f
   408             if self.repo.config.init_cnxset_pool:
   408             if self.repo.config.init_cnxset_pool:
   409                 self.open_source_connections()
   409                 self.open_source_connections()
   410 
   410 
   411 
   411 
   412     def init(self, activated, source_entity):
   412     def init(self, activated, source_entity):
   413         super(NativeSQLSource, self).init(activated, source_entity)
       
   414         self.init_creating(source_entity._cw.cnxset)
       
   415         try:
   413         try:
   416             # test if 'asource' column exists
   414             # test if 'asource' column exists
   417             query = self.dbhelper.sql_add_limit_offset('SELECT asource FROM entities', 1)
   415             query = self.dbhelper.sql_add_limit_offset('SELECT asource FROM entities', 1)
   418             source_entity._cw.system_sql(query)
   416             source_entity._cw.system_sql(query)
   419         except Exception as ex:
   417         except Exception as ex:
   420             self.eid_type_source = self.eid_type_source_pre_131
   418             self.eid_type_source = self.eid_type_source_pre_131
       
   419         super(NativeSQLSource, self).init(activated, source_entity)
       
   420         self.init_creating(source_entity._cw.cnxset)
   421 
   421 
   422     def shutdown(self):
   422     def shutdown(self):
   423         if self._eid_creation_cnx:
   423         if self._eid_creation_cnx:
   424             self._eid_creation_cnx.close()
   424             self._eid_creation_cnx.close()
   425             self._eid_creation_cnx = None
   425             self._eid_creation_cnx = None