This function is used to cancel the debugger transaction. :param trans_id: Transaction id :return:
(_trans_id, close_all=False)
| 2278 | |
| 2279 | |
| 2280 | def close_debugger_session(_trans_id, close_all=False): |
| 2281 | """ |
| 2282 | This function is used to cancel the debugger transaction. |
| 2283 | |
| 2284 | :param trans_id: Transaction id |
| 2285 | :return: |
| 2286 | """ |
| 2287 | |
| 2288 | if close_all: |
| 2289 | trans_ids = DebuggerInstance.get_trans_ids() |
| 2290 | else: |
| 2291 | trans_ids = [_trans_id] |
| 2292 | |
| 2293 | for trans_id in trans_ids: |
| 2294 | de_inst = DebuggerInstance(trans_id) |
| 2295 | dbg_obj = de_inst.debugger_data |
| 2296 | |
| 2297 | try: |
| 2298 | if dbg_obj is not None: |
| 2299 | manager = get_driver(PG_DEFAULT_DRIVER).\ |
| 2300 | connection_manager(dbg_obj['server_id']) |
| 2301 | |
| 2302 | if manager is not None: |
| 2303 | release_connection(manager, dbg_obj) |
| 2304 | |
| 2305 | de_inst.clear() |
| 2306 | except Exception: |
| 2307 | de_inst.clear() |
| 2308 | raise |
no test coverage detected