Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-364

executeBatch won't return an array of update counter when allowMultiQueries=true.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.2, 1.5.3
    • Fix Version/s: 2.0.0-RC, 1.6.0
    • Component/s: aurora
    • Labels:
      None
    • Environment:
      AWS RDS Aurora 5.6.10a
      mariadb-java-client 1.5.3

      Description

       
      try {
                   String connMasterStr = "jdbc:mariadb://my-database-instance-endpoint.rds.amazonaws.com:3306/lodgingHistory?allowMultiQueries=true";
                   Connection connMaster = DriverManager.getConnection(connMasterStr, "myUsername", "myPassword");
       
                   String sql = "insert ignore into foo3 (bar) values (?)";
                   PreparedStatement pstmt = connMaster.prepareStatement(sql);
       
                   int [] vals = new int[4];
                   int start = 106;
                   int dup = 2;
                   for(int i=0;i<3;i++)
                   {
                       vals[i]=start+i;
                       pstmt.setString(1, new Integer(start+i).toString());
                       pstmt.addBatch();
                   }
                   // add the dup
                   pstmt.setString(1, new Integer(dup).toString());
                   pstmt.addBatch();
       
                   int[] updateCounts = pstmt.executeBatch();
                   System.out.println("inserted " + updateCounts.toString());
       
               } catch (Exception ex) {
                   System.out.println("Exception recived " + ex.getMessage());
               }
      

      When the app is executed in main, it stuck and won't return updateCounts. However, eclipse debugger is used to debug the issue, it works and returns an array of update counts. The old version of mariadb connector 1.4.6 and 1.4.4 return update counts as expected.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              diego dupin Diego Dupin
              Reporter:
              seanderson Seonmi Anderson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: