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

JPA repositories mode should not be deferred by default #24249

Closed
snicoll opened this issue Nov 25, 2020 · 3 comments
Closed

JPA repositories mode should not be deferred by default #24249

snicoll opened this issue Nov 25, 2020 · 3 comments
Assignees
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: bug A general bug
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Nov 25, 2020

In Spring Boot 2.3.0 we've introduced deferred JPA bootstrap by default. As a result we got a number of deadlock-related issues. Some relate to the way our own code was interacting with the EntityManagerFactory or how the framework was applying locks and we fixed those. But others were report of user apps that look incidental, for instance using a repository in @PostConstruct.

After considering the pros and cons of each approach, we've decided that asynchronous bootstrap mode should be opt-in and that we should clarify its behaviour and how users can easily opting-in to it, including if they have to manipulate the EMF on startup.

This issue is about flipping the default value. While it is late in the 2.3.x cycle to do so, it is an optimisation and switching back to the previous behaviour should not have any user-facing consequence. The release notes for 2.3.x should also be updated.

Two companion issues are also available to generalize the spring.data.jpa.repositories.bootstrap-mode property (#24248) and to provide a mechanism to know that the EMF lock has been lifted (see spring-projects/spring-framework#26153).

@snicoll snicoll added the type: bug A general bug label Nov 25, 2020
@snicoll snicoll added this to the 2.3.7 milestone Nov 25, 2020
@michaldo

This comment has been minimized.

@snicoll

This comment has been minimized.

@michaldo

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants