コード例 #1
0
 def wrapped_function(*params, **kwargs):
     database_connection_handler = DatabaseConnectionHandler()
     kwargs["database_session"] = database_connection_handler.session
     try:
         return func(*params, **kwargs)
     except Exception as err:
         raise err
     finally:
         database_connection_handler.session.close()
         database_connection_handler.engine.dispose()
コード例 #2
0
        def wrapped_function(*params, **kwargs):
            database_connection_handler = DatabaseConnectionHandler()

            kwargs["database_session"] = database_connection_handler.session

            while True:
                try:
                    return func(*params, **kwargs)
                except OperationalError:
                    continue
                else:
                    database_connection_handler.session.close()
コード例 #3
0
 def process_aplication(self):
     DatabaseConnectionHandler.initialize_db_connection_handler()
     configuration = self.parser.parse_args()
     self.action_handlers[configuration.ACTION].process_action(configuration)
コード例 #4
0
 def __init__(self, configuration):
     self.configuration = configuration
     DatabaseConnectionHandler.initialize_db_connection_handler()
コード例 #5
0
ファイル: test_script.py プロジェクト: 01org/intelRSD
 def __init__(self, configuration):
     self.configuration = configuration
     DatabaseConnectionHandler.initialize_db_connection_handler()