Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-1047

Batch inserts through Maxscale with C/J stall

    XMLWordPrintable

Details

    Description

      Test case:

      public class BatchInsert {
       
          static final String ADDRESS = "127.0.0.1";
          static final String PORT = "4006";
          static final String USER = "maxuser";
          static final String PASSWORD = "maxpwd";
          static final String DB = "test";
       
          public static void main(String[] args) {
              try (Connection connection = DriverManager.getConnection("jdbc:mariadb://"
                      + ADDRESS + ":" + PORT + "/" + DB + "?user=" + USER + "&password="
                      + PASSWORD + "&useBatchMultiSendNumber=500")) {
                  Statement stmt = connection.createStatement();
                  stmt.execute("DROP TABLE IF EXISTS tt");
                  stmt.execute("CREATE TABLE tt (d int)ENGINE=BLACKHOLE");
                  for (int i = 0; i < 300; i++) {
                      stmt.addBatch("INSERT INTO tt(d) VALUES (1)");
                      if (i % 3 == 0) {
                          stmt.addBatch("SET @test2='aaa'");
                      }
                  }
                  stmt.executeBatch();
                  System.out.println("finished");
              } catch (Exception e) {
                  System.out.println("Error: " + e.getMessage());
              }
          }
      }
      

      Attachments

        Activity

          People

            markus makela markus makela
            kjoiner Kyle Joiner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.