Skip to content

Commit b31a2e5

Browse files
author
Samuel Nitsche
committed
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL-java-api into feature/version_check
2 parents 09eeff4 + 51ac9db commit b31a2e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/org/utplsql/api/TestRunner.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ public void run(Connection conn) throws SomeTestsFailedException, SQLException,
105105
if (e.getErrorCode() == SomeTestsFailedException.ERROR_CODE) {
106106
throw new SomeTestsFailedException(e.getMessage(), e);
107107
} else {
108+
// If the execution failed by unexpected reasons finishes all reporters,
109+
// this way the users don't need to care about reporters' sessions hanging.
110+
try (CallableStatement closeBufferStmt = conn.prepareCall("BEGIN ut_output_buffer.close(?); END;")) {
111+
closeBufferStmt.setArray(1, oraConn.createOracleArray(CustomTypes.UT_REPORTERS, this.reporterList.toArray()));
112+
closeBufferStmt.execute();
113+
} catch (SQLException ignored) {}
114+
108115
throw e;
109116
}
110117
} finally {

0 commit comments

Comments
 (0)