Mercurial > hg > monetdb-java
changeset 361:253363a2ae28
Fix for bug 6953.
Also updated Test_Sbatching.java such that no clearBatch() is called anymore after each executeBatch() in a loop.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Wed, 09 Sep 2020 17:32:19 +0200 (2020-09-09) |
parents | a06a76170d39 |
children | 2f72b89e1686 |
files | src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java tests/Test_Sbatching.java |
diffstat | 2 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java @@ -254,6 +254,7 @@ public class MonetStatement // otherwise just return the counts return counts; } finally { + batch.clear(); batchLock.unlock(); } }
--- a/tests/Test_Sbatching.java +++ b/tests/Test_Sbatching.java @@ -33,22 +33,25 @@ public class Test_Sbatching { int[] cnts = stmt.executeBatch(); System.out.println("passed :)"); System.out.print("3. checking number of update counts..."); - if (cnts.length != 400) throw new SQLException("Invalid size: " + cnts.length); + if (cnts.length != 400) + throw new SQLException("Invalid size: " + cnts.length); System.out.println(cnts.length + " passed :)"); System.out.print("4. checking update counts (should all be 1)..."); for (int j = 0; j < cnts.length; j++) { - if (cnts[j] != 1) throw new SQLException("Unexpected value: " + cnts[j]); + if (cnts[j] != 1) + throw new SQLException("Unexpected value: " + cnts[j]); } System.out.println("passed :)"); - System.out.print("5. clearing the batch..."); - stmt.clearBatch(); - System.out.println("passed :)"); } } - System.out.print("6. executing batch..."); + System.out.print("5. executing batch..."); stmt.executeBatch(); System.out.println("passed :)"); + System.out.print("6. clearing the batch..."); + stmt.clearBatch(); + System.out.println("passed :)"); + System.out.print("7. checking table count..."); rs = stmt.executeQuery("SELECT COUNT(*) FROM table_Test_Sbatching"); rs.next();