You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Toshiro Takase (JIRA)" <ji...@apache.org> on 2006/04/07 14:48:23 UTC

[jira] Created: (WSCOMMONS-9) Thread safety of XML{Input|Output}Factory.createXMLStream{Reader|Writer}

Thread safety of XML{Input|Output}Factory.createXMLStream{Reader|Writer}
------------------------------------------------------------------------

         Key: WSCOMMONS-9
         URL: http://issues.apache.org/jira/browse/WSCOMMONS-9
     Project: WS-Commons
        Type: Bug

  Components: AXIOM  
 Environment: Windows
    Reporter: Toshiro Takase


In StAXOMBuilder and MTOMXMLStreamWriter (renamed from OMOutputImpl), XML{Input|Output}Factory is created just once now.
It is great to reuse XMLInputFactory and XMLOutputFactory instance, I think.
But I am not sure whether XMLInputFactory.createXMLStreamReader() and XMLOutputFactory.createXMLStreamWiter() have thread safety or not.
It seems that JSR-173 StAX specification does not mention their thread safety.
IMHO, strictly speaking, these factories can be broken if these methods are called concurrently.
These methods can be enclosed by synchronized block, or a factory instance pool or something can be made.

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


[jira] Updated: (WSCOMMONS-9) Thread safety of XML{Input|Output}Factory.createXMLStream{Reader|Writer}

Posted by "Toshiro Takase (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-9?page=all ]

Toshiro Takase updated WSCOMMONS-9:
-----------------------------------

    Attachment: patch.zip

A possible implementation of factory instance pool.
"svn diff" against latest repository and 2 added classes.
I am not sure whether this is the best way or not.


> Thread safety of XML{Input|Output}Factory.createXMLStream{Reader|Writer}
> ------------------------------------------------------------------------
>
>          Key: WSCOMMONS-9
>          URL: http://issues.apache.org/jira/browse/WSCOMMONS-9
>      Project: WS-Commons
>         Type: Bug

>   Components: AXIOM
>  Environment: Windows
>     Reporter: Toshiro Takase
>  Attachments: patch.zip
>
> In StAXOMBuilder and MTOMXMLStreamWriter (renamed from OMOutputImpl), XML{Input|Output}Factory is created just once now.
> It is great to reuse XMLInputFactory and XMLOutputFactory instance, I think.
> But I am not sure whether XMLInputFactory.createXMLStreamReader() and XMLOutputFactory.createXMLStreamWiter() have thread safety or not.
> It seems that JSR-173 StAX specification does not mention their thread safety.
> IMHO, strictly speaking, these factories can be broken if these methods are called concurrently.
> These methods can be enclosed by synchronized block, or a factory instance pool or something can be made.

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


[jira] Resolved: (WSCOMMONS-9) Thread safety of XML{Input|Output}Factory.createXMLStream{Reader|Writer}

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-9?page=all ]
     
Davanum Srinivas resolved WSCOMMONS-9:
--------------------------------------

    Resolution: Fixed

Please see StAXUtils.java in AXIOM. (created from your code)

thanks,
dims

> Thread safety of XML{Input|Output}Factory.createXMLStream{Reader|Writer}
> ------------------------------------------------------------------------
>
>          Key: WSCOMMONS-9
>          URL: http://issues.apache.org/jira/browse/WSCOMMONS-9
>      Project: WS-Commons
>         Type: Bug

>   Components: AXIOM
>  Environment: Windows
>     Reporter: Toshiro Takase
>  Attachments: patch.zip
>
> In StAXOMBuilder and MTOMXMLStreamWriter (renamed from OMOutputImpl), XML{Input|Output}Factory is created just once now.
> It is great to reuse XMLInputFactory and XMLOutputFactory instance, I think.
> But I am not sure whether XMLInputFactory.createXMLStreamReader() and XMLOutputFactory.createXMLStreamWiter() have thread safety or not.
> It seems that JSR-173 StAX specification does not mention their thread safety.
> IMHO, strictly speaking, these factories can be broken if these methods are called concurrently.
> These methods can be enclosed by synchronized block, or a factory instance pool or something can be made.

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