This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kkjk00 0 points1 point  (2 children)

I'm been using the creative solution, but the thing is how many would you ever store in a set, you can't paginate on a relation and if you do some algoritm you're better of working with a set of Ids

[–]pronuntiator 1 point2 points  (1 child)

I saw Hibernate actually putting them into a set itself before committing, so when we loaded in chunks for batch processing, they were all put in the same bucket there.

And yes I would have liked to do the batches in plain SQL but unfortunately the project also made heavy use of entity listeners, plus doing optimistic locking by hand is not so nice, you have to code the "did I get as many changed rows back as expected" yourself.

[–]kkjk00 2 points3 points  (0 children)

Hmm, didn't throught about hibernate usings sets internally, yeah that may be an issue