[ https://issues.apache.org/jira/browse/PLUTO-601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ate Douma reopened PLUTO-601: ----------------------------- Hi Eric, I'm sorry but I have a problem with (some of) these changes. First of all both XMLInputFactory and DocumentBuilderFactory are not (guaranteed) thread safe! While some implementations do claim to be thread safe, that is not actually required. Stax for instance claims to provide a thread safe XMLInputFactory, but *not* for the configuration, e.g. when using setProperty() to influence its behavior is *not* thread safe. The same seems to hold for DocumentBuilderFactory, hence you can find plenty of advises on the internet to create new instances per usage to ensure stable behaviour. The JAXBContext (and Pattern) however is supposed to be thread safe, so I'm fine with the improvements on those. Note: I haven't yet validated these changes against Portlet TCK 2.0 or current Jetspeed Portal. Another issue is with regard to the creation of the XMLInputFactory instance: that should always be done against the container ClassLoader, e.g. ensure the Thread ContextClassloader is (temporarily) forced. See also the comment I provided on the original getXMLInputFactory(ClassLoader) method. Regards, Ate > Remove expensive object creation in PortletAppDescriptorServiceImpl > ------------------------------------------------------------------- > > Key: PLUTO-601 > URL: https://issues.apache.org/jira/browse/PLUTO-601 > Project: Pluto > Issue Type: Improvement > Components: portlet container > Reporter: Eric Dalquist > Assignee: Eric Dalquist > Fix For: 2.0.3, 2.1.0 > > > PortletAppDescriptorServiceImpl creates new JAXBContext, XMLInputFactory, > DocumentBuilderFactory, and Pattern objects every time they are needed. All > of these objects are thread-safe once created and configured and should only > be created once at the class level and re-used for the life of the class. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.