Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363593 - DOMHandlerConverter is using Transformer in a non-thread-safe manner
Summary: DOMHandlerConverter is using Transformer in a non-thread-safe manner
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 10:28 EST by Blaise Doughan CLA
Modified: 2022-06-09 10:19 EDT (History)
1 user (show)

See Also:


Attachments
MOXy - Fix (2.43 KB, patch)
2011-11-11 10:33 EST, Blaise Doughan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Blaise Doughan CLA 2011-11-11 10:28:20 EST
Currently the MOXy DOMHandlerConverter is holding onto a single instance of Transformer.  Since the DOMHandlerConverter can be used concurrently by multiple threads this means its usage of Transformer is not thread-safe according to the Javadocs for Transformer:

From:  http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Transformer.html
"An object of this class may not be used in multiple threads running concurrently. Different Transformers may be used concurrently by different threads."
Comment 1 Blaise Doughan CLA 2011-11-11 10:33:34 EST
Created attachment 206855 [details]
MOXy - Fix

Create a new instance of Transformer per conversion operation to ensure that Transformer is used in a thread safe manner.
Comment 2 Blaise Doughan CLA 2011-11-11 17:05:58 EST
Fix checked into trunk at rev:  10377
Fix checked into 2.3.2 at rev:  10378 

Code Reviewed By:  Matt MacIvor

Fix Details:
Create a new Transformer per operation instead of reusing the same one to ensure thread-safety.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:19:48 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink