After talking with everyone in the hibernate-orm gitter chat, I realised that my initial assumption of how Hibernate works was wrong - I thought that I could have attached and detached references to the same object (which is not the case). However, after realising this, my previous comment above shows some very strange behaviour - which could be a bug itself. The test should not be passing. Since detach is called last, the changes should not persist at all. I'll downgrade this issue to minor priority. |