Hi,
I have an entity, a Group
, which has User
objects inside it. On creation of a User
, that User
is added to a Group
. This is done through an API, so the flow of control is roughly:
- Complete web form for new user, submit
- Hibernate creates new user, adds user to group
- Website requests group and list of users
- Hibernate loads and returns group
- Website displays group
Now, when the User
is first created, they are never present in the Group
that is returned. On refresh, the User
appears. On another refresh, the User
is present, upon a third (?!) refresh, an ObjectNotFoundException
is thrown for the newly-created User
object.
I have been battling with this for days, I don't know which parts of the Hibernate actions are relevant, so will eagerly provide more details when needed.