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-issuemaster opened this issue Sep 28, 2018 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster 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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.