Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectMapper should detect if the session is already opened #74

Open
VadimKirilchuk opened this issue Sep 25, 2015 · 1 comment
Open

Comments

@VadimKirilchuk
Copy link

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.

@cowtowncoder
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants