Hibernate 6 fails to refresh when collections are accessed in entity setter method when access type is property
Description
Activity
Show:

Scott Marlow April 3, 2023 at 4:07 PM
I’m not yet sure why but the change for this pr seems to cause a WildFly test failure WFLY-17830 that blocks .
To recreate, cd wildfly/testsuite/integration/basic
mvn install -Dtest=org.jboss.as.test.integration.jpa.hibernate.sessionfactorytest.SessionFactoryTestCase
We are having issues with complex @OneToMany relationships. See attached repository, which demonstrates the problem:
https://github.com/knyttl/Hibernate5vs6Test
The repo has HIbernate 5 in pom.xml, so when running the test as:
```bash
mvn test -Dhibernate.server={my-server} -Dhibernate.database={my-database} -Dhibernate.password={my-password} -Dhibernate.user={db-user}
```
You will see the test is *correctly passing*, logs here: https://gist.github.com/knyttl/ac8010f853bc22b1a0176e856cad0a3e
Now please uncomment Hibernate 6 in `pom.xml` and run the test again.
The test will now fail with this log: https://gist.github.com/knyttl/292aeb613fd10b9c9fbf8d7b5d7e2073