JaxbContext is created on everey request
----------------------------------------

                 Key: XFIRE-1128
                 URL: http://jira.codehaus.org/browse/XFIRE-1128
             Project: XFire
          Issue Type: Bug
          Components: JAXB 2.0
    Affects Versions: 1.2.6, 1.2.5, 1.2.4
         Environment: Windows server 2003, IBM JVM 1.5
            Reporter: Lars Milland
            Assignee: Dan Diephouse
             Fix For: 1.2.7, 1.2.6, 1.2.5, 1.2.4


Whe xfire performs a SOAP request where the binding of XML to Java and vice 
versa is done by using JAXB 2.0 the JaxbContext is created on every request. 
Creating a JaxbContext  is a very long running function, particular with large 
schema's and a large Java codebase where annotations defining the JAXB binding 
is descibed.

The method getJAXBContext of the type "org.codehaus.xfire.jaxb2.JaxbType" 
should cache the JaxbContext for later use to avoid paying the performance 
overhead of creating a new JaxbContext.

A similar issue is reported on CXF: 
https://issues.apache.org/jira/browse/CXF-850

The fix could look something like this:

            if (cachedContexts.containsKey(pckg) == false) 
            {
                        synchronized(cachedContexts) 
                        {
                                    if (cachedContexts.containsKey(pckg) == 
false) {
                                        cachedContexts.put(pckg, 
JAXBContext.newInstance(pckg));
                                    }
                        }
                        context = cachedContexts.get(pckg);
            }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to