| This is expected behavior. When the second transaction is committed, the session is flushed and the persist operation is performed on A, which still has an association with B. The association has cascade=PERSIST, so the persist operation is performed on B. According to JPA 2.1, 3.2.2 Persisting an Entity Instance: "If X is a removed entity, it becomes managed." Hibernate "rescues" B from being deleted, as it should. |