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

SpringBeanContainer not working with Hibernate Search's ParameterizedBridge [SPR-17311] #21844

Open
spring-projects-issues opened this issue Sep 28, 2018 · 1 comment
Labels
in: data type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Sep 28, 2018

mihxil opened SPR-17311 and commented

I tried to upgrade my project using spring and hibernate to spring 5.1.

I use customized search mappings via org.hibernate.search.cfg.SearchMapping and have some instances were we customize a bridge via org.hibernate.search.cfg.FieldMapping#bridge.

 

I noticed that the classes I supply there must now be instantiated with spring. This surprised me a bit, but well.

 

The issue arises if the class is also a org.hibernate.search.bridge.ParameterizedBridge, and we set some 'params'  (org.hibernate.search.cfg.FieldBridgeMapping#param)

 

Different fields with the same bridge implementation but with different params, now receive the same instance of the class, so things gets mixed up. The param of one field influences the behaviour of another field.

It boils down to that parameterized bridges get unusable. The first thought was, since the instance are now managed by spring, that I could also configure them there, but it seems that they are matched on class only, so I have to extend the bridge for every instance with different params, more or less mooting the complete point of parametrization.

It could be that I missed something, but I couldn't easily find out what that would be.

 


Affects: 5.1 GA

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 29, 2018

Juergen Hoeller commented

Not sure whether the bug is in Hibernate 5.3's handling of the BeanContainer SPI or in Spring's SpringBeanContainer implementation... Could you try to debug the latter and see which callback you get for your beans (that seem to end up at the same instance)?

@spring-projects-issues spring-projects-issues added type: bug in: data labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data type: bug
Projects
None yet
Development

No branches or pull requests

1 participant