Exemplo n.º 1
0
Arquivo: worker.py Projeto: xbx/zato
 def init_sql(self):
     """ Initializes SQL connections, first to ODB and then any user-defined ones.
     """
     # We need a store first
     self.sql_pool_store = PoolStore()
     
     # Connect to ODB
     self.sql_pool_store[ZATO_ODB_POOL_NAME] = self.worker_config.odb_data
     self.odb = SessionWrapper()
     self.odb.init_session(ZATO_ODB_POOL_NAME, self.worker_config.odb_data, self.sql_pool_store[ZATO_ODB_POOL_NAME].pool)
     
     # Any user-defined SQL connections left?
     for pool_name in self.worker_config.out_sql:
         config = self.worker_config.out_sql[pool_name]['config']
         self.sql_pool_store[pool_name] = config
Exemplo n.º 2
0
 def sql_pool_store(self):
     return PoolStore()