-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Caching conflict when creating CSV schemas with different views for the same POJO #288
Comments
Oh. Yes indeed... Gnarly one, this. Wonder if this should initially (2.13?) simply avoid caching when there is active |
In my eyes, caching only when |
Fixed for upcoming 2.13.1 by simply skipping caching if view enabled. May be improved in future if someone has an itch; just need to change key for cache. |
What would be suitable to create a corresponding key from |
I can't think of a type and since we cannot add 3rd party
|
Sure, I can try to find some time. Should I create a PR based on |
2.14: keeping caching simple for 2.13 patch just in case. There isn't a lot about contributing, just this: https://github.com/FasterXML/jackson/blob/master/CONTRIBUTING.md |
#195 added csv schema creation with views. Using the same CsvMapper with the same POJO for different views leads to unexpected results as the used view is not considered when a schema is loaded from cache as it was registered for the pojoType. Obviously, the used view should be part of the key for the cache maps
_untypedSchemas
and_typedSchemas
.jackson-dataformats-text/csv/src/main/java/com/fasterxml/jackson/dataformat/csv/CsvMapper.java
Lines 425 to 433 in 1202fec
Edit: A workaround is quite simple. In order to clear the cache, just use
csvmapper.copy().schemaForWithView(...)
instead ofcsvmapper.schemaForWithView(...)
.The text was updated successfully, but these errors were encountered: