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.