Skip to content

Commit

Permalink
[rdbms]
Browse files Browse the repository at this point in the history
- clear off cache RDBMS metadata and connections between script execution to avoid incorrect DB authentication.

Signed-off-by: automike <[email protected]>
  • Loading branch information
mikeliucc authored and mikeliu-cvet committed May 30, 2022
1 parent fba7123 commit 7c746f4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/org/nexial/core/ExecutionThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import static org.nexial.core.NexialConst.Iteration.*;
import static org.nexial.core.NexialConst.LogMessage.*;
import static org.nexial.core.NexialConst.Project.appendLog;
import static org.nexial.core.NexialConst.Rdbms.DAO_PREFIX;
import static org.nexial.core.NexialConst.Web.*;
import static org.nexial.core.SystemVariables.getDefault;
import static org.nexial.core.SystemVariables.getDefaultBool;
Expand Down Expand Up @@ -250,9 +251,6 @@ public void run() {
}
}

System.setProperty(OPT_OPEN_EXEC_REPORT,
context.getStringData(OPT_OPEN_EXEC_REPORT, getDefault(OPT_OPEN_EXEC_REPORT)));

onScriptComplete(context, executionSummary, iterationManager, ticktock);

ExecutionThread.unset();
Expand Down Expand Up @@ -429,6 +427,9 @@ protected void onScriptComplete(ExecutionContext context,
summary.aggregatedNestedExecutions(context);
NexialListenerFactory.fireEvent(NexialExecutionEvent.newScriptEndEvent(summary.getScriptFile(), summary));

System.setProperty(OPT_OPEN_EXEC_REPORT,
context.getStringData(OPT_OPEN_EXEC_REPORT, getDefault(OPT_OPEN_EXEC_REPORT)));

CloudWebTestingPlatform.reportCloudBrowserStatus(context, summary, ScriptComplete);

StringBuilder cloudOutputBuffer = new StringBuilder();
Expand Down Expand Up @@ -460,6 +461,9 @@ protected void onScriptComplete(ExecutionContext context,

context.getExecutionEventListener().onScriptComplete();

// clear off RDBMS related context variables
context.removeDataByPrefix(DAO_PREFIX);

if (context.hasData(LAST_PLAN_STEP)) {
System.setProperty(LAST_PLAN_STEP, context.getStringData(LAST_PLAN_STEP, getDefault(LAST_PLAN_STEP)));
}
Expand Down

0 comments on commit 7c746f4

Please sign in to comment.