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

Closed
spring-projects-issues opened this issue Sep 28, 2018 · 2 comments
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug

Comments

@spring-projects-issues
Copy link
Collaborator

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

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 A general bug in: data Issues in data modules (jdbc, orm, oxm, tx) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
@jhoeller
Copy link
Contributor

Closing this since we are not aware of any misbehavior on Spring's end. Note that SpringBeanContainer has been revised quite a bit, so in case there is still an issue here, please confirm it against the latest 6.0.11 release (which includes #30683).

@jhoeller jhoeller removed this from the 6.x Backlog milestone Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants