Sergey Kovalenko opened SPR-15263 and commented
I'm mapping multimap in Hibernate: - it works fine with pure Hibernate; - it behaves strangely when I use Hibernate along with Spring.
There are 2 situations: 1. I save a non-empty multimap (I add 'this' element1 to the multimap), then add element2 to the multimap and update, after that the multimap contains element2 and element1 (which is fine). 2. I save an empty multimap, then add element2 to the multimap and update, after that the multimap is empty (but I expect to see element2 in the multimap).
In the first situation, during update in function flushCollections(..) !attach1.png|thumbnail!
I get ce.doupdate = true !attach2.png|thumbnail!
In situation 2, I get doupdate = false !attach3.png|thumbnail!
I’ve tried using different Spring’s versions: 4.0.5.RELEASE, 4.2.2.RELEASE, 4.3.6.RELEASE. You can find it in attachments, situation 1: if you uncomment mmapl.put(-10, this) in Some’s constructor; situation 2: if you comment mmapl.put(-10, this) in Some’s constructor.
Attachments: - attach1.png (435.93 kB) - attach2.png (250.25 kB) - attach3.png (344.56 kB) - hibernate_multimap.zip (13.54 kB)
Comment From: spring-projects-issues
Juergen Hoeller commented
Spring isn't involved with user custom type handling at all. I suspect that the difference in behavior comes from using transactions with Hibernate, no matter whether triggered by Spring or with manual begin/commit calls. So when you're saying it works fine with "pure Hibernate", could you please double-check that the setup is equivalent, i.e. including transactions?
Comment From: bclozel
Closing as we never got feedback from the reporter.