Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fjtorres
Copy link
Contributor

@fjtorres fjtorres commented Mar 23, 2017

Fixes #6041 and #7037

}
throw t;
} finally {
entityManagerContext.pop(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a separate if check makes sense here instead of checking the value of a different variable and assuming they're always the same (which even if true now has more potential to break later):

if (entityManagerContext != null) {
  entityManagerContext.pop(true);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if must check entityManager because the problem of the associated issue occurs when the entityManager is not pushed in the entityManagerContext. So the call to pop method only should occurs when the entityManager is not null.

You can check issues #6041 and #7037 to get more information.

Copy link
Member

@gmethvin gmethvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description should explain what the PR actually does. e.g. "Only call entityManagerContext.pop if the EntityManagerContext is set".

@fjtorres fjtorres changed the title Resolve issue #6041 and #7037 Only call entityManagerContext.pop if the EntityManager is set Mar 27, 2017
Copy link
Member

@marcospereira marcospereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@gmethvin gmethvin merged commit 3db5f91 into playframework:master Apr 17, 2017
gmethvin pushed a commit that referenced this pull request Apr 17, 2017
@marcospereira marcospereira added this to the 2.5.15 milestone Apr 18, 2017
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

Successfully merging this pull request may close these issues.

5 participants