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

Refine RedisCollectionFactoryBean collection creation #2633

Closed
mp911de opened this issue Jul 10, 2023 · 0 comments
Closed

Refine RedisCollectionFactoryBean collection creation #2633

mp911de opened this issue Jul 10, 2023 · 0 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@mp911de
Copy link
Member

mp911de commented Jul 10, 2023

RedisCollectionFactoryBean creates a RedisStore by considering either the key type or the specified CollectionType depending on whether the underlying key exists. It is possible to define a CollectionType.LIST while an existing key can have the type HASH. In that case, the existing type defines the collection type.

It would be good to have a fallback mechanism, if the collection type is not defined, then let the existing key control the type. If a type is defined and the key has a different one, then we should fail with an IllegalStateException.

@mp911de mp911de added the type: enhancement A general enhancement label Jul 10, 2023
@mp911de mp911de self-assigned this Jul 10, 2023
@mp911de mp911de changed the title Refine RedisCollectionFactoryBean collection creation Refine RedisCollectionFactoryBean collection creation Jul 12, 2023
mp911de added a commit that referenced this issue Jul 12, 2023
We now cross-check the existing key type against the specified CollectionType to avoid collection creation that doesn't match the configured CollectionType. If the existing key type doesn't match the configured CollectionType, collection creation fails with a validation error.

Closes #2633
@christophstrobl christophstrobl added this to the 3.2 M1 (2023.1.0) milestone Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants