Changeset: 007c2a1ace02 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=007c2a1ace02
Modified Files:
        java/tests/Test_PSmanycon.java
        sql/jdbc/tests/Tests/Test_PSmanycon.stable.out
Branch: Aug2011
Log Message:

Test_PSmanycon: inject faulty transactions

Inject a faulty transaction, as this may have triggered a problem with
prepared handles, but unfortunately, it doesn't.


diffs (41 lines):

diff --git a/java/tests/Test_PSmanycon.java b/java/tests/Test_PSmanycon.java
--- a/java/tests/Test_PSmanycon.java
+++ b/java/tests/Test_PSmanycon.java
@@ -56,6 +56,18 @@ public class Test_PSmanycon {
                                System.out.print(" result: " + rs.getString(1));
                                pstmt.getConnection().close();
                                System.out.println(", done");
+
+                               if ((i + 1) % 23 == 0) {
+                                       // inject a failed transaction
+                                       Connection con = 
DriverManager.getConnection(args[0]);
+                                       Statement stmt = con.createStatement();
+                                       try {
+                                               int affrows = 
stmt.executeUpdate("update foo where bar is wrong");
+                                               System.out.println("oops, 
faulty statement just got through :(");
+                                       } catch (SQLException e) {
+                                               System.out.println("Forced 
transaction failure");
+                                       }
+                               }
                        }
                } catch (SQLException e) {
                        System.out.println("FAILED! " + e.getMessage());
diff --git a/sql/jdbc/tests/Tests/Test_PSmanycon.stable.out 
b/sql/jdbc/tests/Tests/Test_PSmanycon.stable.out
--- a/sql/jdbc/tests/Tests/Test_PSmanycon.stable.out
+++ b/sql/jdbc/tests/Tests/Test_PSmanycon.stable.out
@@ -123,6 +123,7 @@ Executing PreparedStatement 19... result
 Executing PreparedStatement 20... result: 20, done
 Executing PreparedStatement 21... result: 21, done
 Executing PreparedStatement 22... result: 22, done
+Forced transaction failure
 Executing PreparedStatement 23... result: 23, done
 Executing PreparedStatement 24... result: 24, done
 Executing PreparedStatement 25... result: 25, done
@@ -146,6 +147,7 @@ Executing PreparedStatement 42... result
 Executing PreparedStatement 43... result: 43, done
 Executing PreparedStatement 44... result: 44, done
 Executing PreparedStatement 45... result: 45, done
+Forced transaction failure
 Executing PreparedStatement 46... result: 46, done
 Executing PreparedStatement 47... result: 47, done
 Executing PreparedStatement 48... result: 48, done
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to