I am working on migrating an existing Spring application from Eclipselink version 2.5.2 to 4.0.2. In this application, there is a API in which the data is saved using the JpaRespository to the data, and once the loop ends it does a repo.flush(). Depending on the data, the loop creates the statement for inserting thousand of records to the database, if this number is huge, then I am getting the below error from the DB2 database:
[INFO] [err] ***** Out of Package Error Occurred (2024-03-28 20:34:23.76) *****
[INFO]
[INFO] Exception stack trace:
[INFO] com.ibm.db2.jcc.am.SqlException: NULLID.SYSLH103 0X5359534C564C3031
Concurrently open statements:
[INFO] 1. SQL string: INSERT INTO TEST.TABLE1 (CTRYCODE) VALUES (?)
[INFO] Number of statements: 1338
Here is the code which is causing this
Table1 tab;
for (Table1Dto iterator : records) {
tab = new Table1();
tab.setData(iterator.getData());
repo.save(tab);
}
repo.flush();
And here are all the properties set
<prop key="eclipselink.target-database">DB2</prop>
<prop key="eclipselink.jdbc.cache-statements">true</prop>
<prop key="eclipselink.weaving">false</prop>
<prop key="eclipselink.id-validation">NULL</prop>
<prop key="eclipselink.cache.shared.default">false</prop>
<prop key="eclipselink.external-transaction-controller">true</prop>
<prop key="eclipselink.jdbc.batch-writing">JDBC</prop>
<prop key="eclipselink.jdbc.batch-writing.size">200</prop>
<prop key="eclipselink.logging.level">SEVERE</prop>
<prop key="eclipselink.logging.level">FINE</prop>
<prop key="eclipselink.logging.level.sql">FINE</prop>
I suspect that the statement caching is not working as expected. Can someone provide any more information? I do have the property eclipselink.jdbc.cache-statements set to true.
The application on the previous version of eclipselink was working fine in these scenarios. Has anything changed in newer version of eclipselink which could cause this?
Let me know if I need to share any more information.