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

Resolves #26 Added HibernateQueryOnRequestResetInterceptor #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hollerweger
Copy link

Resolves #26 Added HibernateQueryOnRequestResetInterceptor which can be used to reset query detection state on each request

…r which can be used to reset query detection state on each request
@Hollerweger
Copy link
Author

Tried first with using request scope for HibernateQueryInterceptor instead of ThreadLocal but this caused issued with direct repository access in my test setup.
I was able to solve the issue with adding the HibernateQueryOnRequestResetInterceptor.
See Readme update on how to integrate.

@@ -57,6 +57,11 @@
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Copy link
Owner

Choose a reason for hiding this comment

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

That's a big dependency that may break projects of other users.
@reitzmichnicht Do you have an opinion since you optimized the dependencies?

@@ -46,7 +46,7 @@ public HibernateQueryInterceptor(
/**
* Reset the N+1 query detection state
*/
private void resetNPlusOneQueryDetectionState() {
public void resetNPlusOneQueryDetectionState() {
Copy link
Owner

Choose a reason for hiding this comment

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

protected should be enough

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.

Issue with wrong eager fetch reported
2 participants