OpenSessionInView - detached entities eventually comes apart after span 3 levels associations
While operating roster demo... see attached updated code
1. create league
2. create save league
3. edit league
4. create organization
5. save organization
6. edit organization
7. create team
8. save team
9. edit team
10. see stack trace for app crash
These associations span 3 levels.
In this particular case, when the parent of a collection is referenced in the child edit page, a simple lock
on the parent object
is not enough, the parent object needs to be reloaded.
To reload it there is a new PropertyPersistenceStrategy called ReloadReattachPropertyPersistenceStrategy
I've configure roster example to use ReloadReattachPropertyPersistenceStrategy by default when dealing with "parent" objects.
You can also explicitly use the ReloadReattachPropertyPersistenceStrategy, it's strategy-id is: "reattach-reload"