You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When spring integration test is annotated with @transactional, persists a child entity and then calls a controller to return the parent entity then exception is thrown. It happens because the child entity is stored in a first session opened by @transactional and object mapper tries to open another session to convert the parent entity to json, so the child entity appears in two sessions which lead to the exception.
The text was updated successfully, but these errors were encountered:
Sounds like transaction could be stored in a context attribute (SerializerProvider.setAttribute() etc) when being created, then accessed from there.
Pull Requests would be most welcome!
Please refer to stackoverflow
When spring integration test is annotated with @transactional, persists a child entity and then calls a controller to return the parent entity then exception is thrown. It happens because the child entity is stored in a first session opened by @transactional and object mapper tries to open another session to convert the parent entity to json, so the child entity appears in two sessions which lead to the exception.
The text was updated successfully, but these errors were encountered: