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

Remove Shared EntityManager's synthetic setting to support bean post processing. #2730

Closed
kzander91 opened this issue Dec 14, 2022 · 10 comments
Assignees
Labels
theme: aot type: regression A regression from a previous release

Comments

@kzander91
Copy link

The EntityManager registered in JpaRepositoryConfigExtension is synthetic (which is new as of 3.0). Synthetic beans are not post-processed by Spring, in particular it is therefore no longer possible to apply AOP interceptors to it.

See spring-projects/spring-boot#33510 and 1bfc359#r82897830 for details.

@schauder
Copy link
Contributor

@christophstrobl Could you take a look? Especially at the referenced comment? That was on an AOT related change.

@christophstrobl
Copy link
Member

@schauder will, do. might take some time though.

@christophstrobl
Copy link
Member

christophstrobl commented Dec 15, 2022

I gave it a quick try without the synthetic flag wich seems to be fine also in AOT/native mode. But I need to do some further investigation. Chances are good this is a leftover that should have been removed. Things changed quite a bit since July.
Thanks for reporting @kzander91 !

@quaff
Copy link
Contributor

quaff commented Jan 29, 2023

Any update?

@quaff
Copy link
Contributor

quaff commented Feb 20, 2023

@gregturn It's a regression block upgrading, could you resolve it ASAP?

@quaff
Copy link
Contributor

quaff commented Mar 3, 2023

@christophstrobl Would you take a look?

quaff added a commit to quaff/spring-data-jpa that referenced this issue Mar 17, 2023
quaff added a commit to quaff/spring-data-jpa that referenced this issue Mar 17, 2023
@gregturn gregturn added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 20, 2023
@quaff
Copy link
Contributor

quaff commented May 17, 2023

What's the decision?

@christophstrobl
Copy link
Member

Removing entityManager.setSynthetic(true) from JpaRepositoryConfigExtension worked for the aot/native smoke test.

@quaff
Copy link
Contributor

quaff commented Jun 10, 2023

Then it's safe to merge #2866.

gregturn pushed a commit that referenced this issue Jun 14, 2023
AOT no longer needs this bean to be synthetic to work properly. And this attribute hampers BeanPostProcessors from being applied.

See #2730
Original Pull Request: #2866
gregturn pushed a commit that referenced this issue Jun 14, 2023
AOT no longer needs this bean to be synthetic to work properly. And this attribute hampers BeanPostProcessors from being applied.

See #2730
Original Pull Request: #2866
gregturn pushed a commit that referenced this issue Jun 14, 2023
AOT no longer needs this bean to be synthetic to work properly. And this attribute hampers BeanPostProcessors from being applied.

See #2730
Original Pull Request: #2866
@gregturn gregturn added type: regression A regression from a previous release and removed type: task A general task labels Jun 14, 2023
@gregturn
Copy link
Contributor

Merged to main, backported to 3.1.x and 3.0.x.

@gregturn gregturn added this to the 3.0.7 (2022.0.7) milestone Jun 14, 2023
@gregturn gregturn changed the title Shared EntityManager is synthetic, preventing bean post processing Remove Shared EntityManager's synthetic setting to support bean post processing. Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot type: regression A regression from a previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants