| Thank you very much for taking the time to look at my code. I really appreciate that! I was under the impression that flushing is done automatically. The flushmode should only determine when this flush happens as far as i know. I also ran the code you provided with the exact same result as mine. Index 1 occurs two times and index 0 has vanished in the database. Consequently bar1 disappears from the list. It’s not that the data expected is not written to the database. The problem is that hibernate only rewrites the affected indices. This is not sufficient to create transactional safety (in the sense of keeping the collection sane) from my point of view. |