| If you need per-request configuration, use {@link #writer(DateFormat)} to
* create properly configured {@link ObjectWriter} and use that; this because
* {@link ObjectWriter}s are thread-safe whereas ObjectMapper itself is only
* thread-safe when configuring methods (such as this one) are NOT called.
Does this mean that ObjectMapper itself cannot be thread-safe when we set a date format ? Does this mean that DateFormat isn't thread-safe ? DateFormat's aren't thread-safe. |
--
You received this message because you are subscribed to the Google Groups "jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user+unsubscribe@googlegroups.com.
To post to this group, send email to jackso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
First question based on your reply.>>Usage of `DateFormat` itself is synchronized such that this aspect itself is not problematicThe code synchronizes 'DateFormat' when mapping data across multiple threads ? Where exactly is this done ?
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user+unsubscribe@googlegroups.com.
| I find this in DateDeserializers.java synchronized (_customFormat) { | |
| try { | |
| return _customFormat.parse(str); | |
| } catch (ParseException e) { | |
| return (java.util.Date) ctxt.handleWeirdStringValue(handledType(), str, | |
| "expected format \"%s\"", _formatString); | |
| } | |
| } |