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

    XMLWordPrintable

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

          People

            diego dupin Diego Dupin
            JohnCover John Cover
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.5d
                0.5d

                Git Integration

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