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

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.5.2, 1.5.3
    • 2.0.0-RC, 1.6.0
    • aurora
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.