Hi,
I was wondering if their is a best practice around for updating/flushing huge amount of data. I have mapping on a table of 65000 rows and about 50 columns (some of them are more then 1000 bytes long).
Now I want to retrieve all entries in a n object collection. Works fine without problems. I have them in a List<MyObject>. Now I go over all Objects in the list and want to change certain values in each Object.
First I tried to make all changes and did a session flush afterwards. This approach caused exceptions, since it was obviously too big.
Second I tried to do an update of all Objects against my Database. here the pseudo code
- beginn transaction
- loop over my List
- update(single Object in my List)
- end of loop
- transaction commit
Unfortunately I received the same error as with the described flushing approach.
Now I flush after each Object changed. Of course it takes a lot of time, but at least it works. Is their any best practice for these amounts of data??
Thanks in advance for your feedback
antoschka
|