Is there a way to set the batch size for the Spring object's NamedParameterJdbcTemplate?
I ran into some OutOfMemory problems in my project, but I was able to solve it by calling NamedParameterJdbcTemplate in a loop of smaller fragments. But this required a few additional efforts, such as determining the size of a piece, breaking a large list into smaller sublists, etc.
I was wondering if NamedParameterJdbcTemplate has such a direct way, I can specify the batch size for it. I don't see anything in the API documentation. But they have something in the JDBCTemplate. Now, if I need to switch to JDBCTemplate, I will have to redo the code: (
Please offer.
source share