[
https://issues.apache.org/jira/browse/OPENJPA-2954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18116550#comment-18116550
]
ASF subversion and git services commented on OPENJPA-2954:
----------------------------------------------------------
Commit fa4302ce213e4ca6728272840219372d6781a1b6 in openjpa's branch
refs/heads/OPENJPA-2977-no-persistence-xml-resource from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=fa4302ce2 ]
[OPENJPA-2954] Publish the cached AttributeConverter instance safely
FieldMetaData and ConverterElementHandler are shared across brokers and
threads. Make the lazily populated converter caches volatile and create
the converter instance with double-checked locking so exactly one
instance is published. Document that converter instances are shared and
must be thread-safe.
> Unsafe publication of cached AttributeConverter instance
> --------------------------------------------------------
>
> Key: OPENJPA-2954
> URL: https://issues.apache.org/jira/browse/OPENJPA-2954
> Project: OpenJPA
> Issue Type: Sub-task
> Components: jpa
> Affects Versions: 4.2.0
> Reporter: Maxim Solodovnik
> Assignee: Richard Zowalla
> Priority: Major
> Fix For: 4.2.0
>
>
> Discussion thread:
> https://github.com/apache/openjpa/pull/144#discussion_r3682999838
> **(medium)** The converter instance is now created once and cached in a
> non-volatile field without synchronization; FieldMetaData is shared across
> brokers/threads, so this is unsafe publication and a behavior change
> (previously a new converter instance per conversion, now one shared instance
> that must be thread-safe). Consider thread-safe caching and documenting that
> AttributeConverters are treated as shared/stateless.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)