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

3.0.5 -> 3.0.6 causing batch updates to hang indefinitely

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Cannot Reproduce
    • 3.0.6
    • N/A
    • Other
    • None

    Description

      I'm struggling to resolve a bug that was introduced when updating mariadb-java-client from 3.0.4 to 3.0.5 and exists still in the latest 3.1.3 version.

      The following code snippet will hang without ever actually generating any SQL logging via Eclipse Link's logging mechanisms:

          public void batchUpdate(List<ContactListEntity> contactList) throws SQLException {
              EntityManager em = null;
       
              try {
                  em = getEntityManager();
                  em.getTransaction().begin();
                  int i = 0;
       
                  for (ContactListEntity c : contactList) {
                      em.merge(c);
                      if (i % 500 == 0) {
                          em.flush();
                          em.clear();
                      }
                      i++;
                  }
                  em.getTransaction().commit();
              } catch (Exception e) {
                  e.printStackTrace();
                  if (em != null) em.getTransaction().rollback();
                  throw new SQLException(e.getMessage());
              } finally {
                  if (em != null) {
                      em.close();
                  }
              }
          }
      

      Here's the current persistence configuration file utilized by EclipseLink in case it's helpful:

              <properties>
                  <property name="javax.persistence.jdbc.driver" value="org.mariadb.jdbc.Driver"/>
                  <property name="eclipselink.jdbc.batch-writing" value="JDBC"/>
                  <property name="eclipselink.jdbc.batch-writing.size" value="500"/>
                  <property name="eclipselink.jdbc.bind-parameters" value="TRUE"/>
              </properties>
      

      Reverting to 3.0.5 resolves the issue.

      Attachments

        Activity

          diego dupin Diego Dupin added a comment -

          I've tryed to reproduced that problem without success.

          I suspect that problem reside in aurora that is known to have some proxy issue since the beginning. This problem has been known since the beginning of aurora (I reported it to the managers more than 9 years ago...). this is one of the reasons why aurora specific support has been removed for version 3 of the connector.

          If this is the culprit, the workaround is to set option 'disablePipeline' in connection url, like 'jdbc:mariadb://myhost/db?disablePipeline=true'

          diego dupin Diego Dupin added a comment - I've tryed to reproduced that problem without success. I suspect that problem reside in aurora that is known to have some proxy issue since the beginning. This problem has been known since the beginning of aurora (I reported it to the managers more than 9 years ago...). this is one of the reasons why aurora specific support has been removed for version 3 of the connector. If this is the culprit, the workaround is to set option 'disablePipeline' in connection url, like 'jdbc:mariadb://myhost/db?disablePipeline=true'
          diego dupin Diego Dupin added a comment -

          Closing since not reproduced and no additional info. Feel free to create a new issue/link to this one if still having the problem

          diego dupin Diego Dupin added a comment - Closing since not reproduced and no additional info. Feel free to create a new issue/link to this one if still having the problem

          People

            diego dupin Diego Dupin
            JohnCover John Cover
            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.