Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Cannot Reproduce
-
3.0.6
-
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.
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'