poll_end_execution_result(trans_id) This method polls the end of execution result messages returned by the database server. Parameters: trans_id - unique transaction id.
(trans_id)
| 2132 | ) |
| 2133 | @pga_login_required |
| 2134 | def poll_end_execution_result(trans_id): |
| 2135 | """ |
| 2136 | poll_end_execution_result(trans_id) |
| 2137 | |
| 2138 | This method polls the end of execution result messages returned by the |
| 2139 | database server. |
| 2140 | |
| 2141 | Parameters: |
| 2142 | trans_id |
| 2143 | - unique transaction id. |
| 2144 | """ |
| 2145 | |
| 2146 | de_inst = DebuggerInstance(trans_id) |
| 2147 | if de_inst.debugger_data is None: |
| 2148 | return make_json_response( |
| 2149 | data={'status': 'NotConnected', |
| 2150 | 'result': SERVER_CONNECTION_CLOSED |
| 2151 | } |
| 2152 | ) |
| 2153 | |
| 2154 | manager = get_driver(PG_DEFAULT_DRIVER).connection_manager( |
| 2155 | de_inst.debugger_data['server_id']) |
| 2156 | conn = manager.connection( |
| 2157 | did=de_inst.debugger_data['database_id'], |
| 2158 | conn_id=de_inst.debugger_data['conn_id']) |
| 2159 | |
| 2160 | if conn.connected(): |
| 2161 | status, result, statusmsg = poll_data(conn) |
| 2162 | if not status: |
| 2163 | status = 'ERROR' |
| 2164 | return make_json_response( |
| 2165 | info=gettext("Execution completed with an error."), |
| 2166 | data={ |
| 2167 | 'status': status, |
| 2168 | 'status_message': result |
| 2169 | } |
| 2170 | ) |
| 2171 | |
| 2172 | if status == ASYNC_OK and \ |
| 2173 | not de_inst.function_data['is_func'] and\ |
| 2174 | (de_inst.function_data['language'] == 'edbspl' or |
| 2175 | de_inst.function_data['language'] == 'plpgsql'): |
| 2176 | status = 'Success' |
| 2177 | _, statusmsg = get_additional_msgs(conn, statusmsg) |
| 2178 | |
| 2179 | return make_json_response( |
| 2180 | success=1, |
| 2181 | info=gettext("Execution Completed."), |
| 2182 | data={ |
| 2183 | 'status': status, |
| 2184 | 'status_message': statusmsg |
| 2185 | } |
| 2186 | ) |
| 2187 | if result: |
| 2188 | return check_result(result, conn, statusmsg) |
| 2189 | else: |
| 2190 | status = 'Busy' |
| 2191 | _, statusmsg = get_additional_msgs(conn, statusmsg) |
nothing calls this directly
no test coverage detected