Skip to content

Unnecessary string distance calculation when using @Field [DATAMONGO-1991] #2862

Closed as not planned
@spring-projects-issues

Description

@spring-projects-issues

Ludek Novotny opened DATAMONGO-1991 and commented

When @Field annotation is used to have different Mongo Document field name than bean field name, string distance (org.springframework.beans.PropertyMatches.calculateStringDistance) is calculated for all combinations of fields. If the distance is too big, name from annotation is used as fallback.

This causes a big performance hit in our application. Our solution was to implement cache in PropertyMatches but more permanent solution would be appreciated as we don't really want to maintain our version of spring-beans. We also believe the cache isn't the best solution. Is there a reason why field name from @Field isn't used with highest priority and string distance would be fallback?

This issue is somehow related to BATCH-1876. But our use case is with Mongo. Our application is running on Spring Boot 2.0.0-RELEASE


Reference URL: https://jira.spring.io/browse/BATCH-1876

Metadata

Metadata

Assignees

Labels

status: supersededAn issue that has been superseded by another

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions