I have a database which contains two tables (simplified) to a Session that contains Records, where one Session can contain somewhere between 1,000 and 10,000 records.
After receiving the Session data (with Records) and saving it in the database - which takes a total of 200ms when using the solution from my previous question from a year ago: JPA/Hibernate improve batch insert performance
which is good enough for the situation.
Now, after it has been saved I need to go through all the records and calculate values for two columns (these can't be calculated before Records have been saved).
When looping through all the records and saving each record - the process takes way too long (~30 records per second) making a 5000 record Session calculation take about 2 minutes.
Now, if I try to do the same thing as I did with insert and use a Hibernate Session to 'batch' the update - the data is calculated very quickly (20,000 rows per second) but the columns in the database are not updated with these new values.
Any ideas why the 'session trick' (described in my linked question) works very well for INSERT but fails silently for UPDATE queries? I'm not catching any exceptions and ignoring them, nor are there any exceptions being logged while this is running.