Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363593

Summary: DOMHandlerConverter is using Transformer in a non-thread-safe manner
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
MOXy - Fix none

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