From here I learned that \[code\]org.w3c.dom.Node\[/code\] (and other classes in the same package) are not thread-safe.I am asking myself if and how should I cache those classes?
- Is there a best approach?
- Do immutable wrapper classes exist?
- Should I use a \[code\]ThreadLocal\[/code\] for the \[code\]DocumentBuilder\[/code\]/\[code\]DocumentBuilderFactory\[/code\] instead
and recreate the \[code\]Node\[/code\] everytime? - What do you do?