After looking through a bunch of use cases/test cases, I really think in
this situation it will have to be up to the user to either:
1) make sure the proxy is used in a synchronized block
or
2) make sure they use unique proxy instances on different threads.
The main use case that I'm seeing a LOT of (and works with the RI) is
that when an application starts up, they create the Proxies (possibly
multi proxies that are stored in a proxy pool of some sort) and
configure the various attributes like ENDPOINT_URL, SESSION_MAINTAIN,
etc... Once configured, the proxies are stored and then used later.
The later use can occur on any thread. With the current setup, all the
stuff that was pre-configured is lost. Thus, the applications don't
work with CXF.
From my standpoint, that's the use case that needs to work with CXF.
Right. That's the exact problem I have ran into. Thanks for explaining
it so clearly :)
Bottom line I think is that the spec needs to be clarified on this
issue. For Dispatch instances the spec is very clear by explicitly
stating that they are not thread safe (section 4.3.1).
Anyway, I just committed this change (same patch as I attached to this
thread before).
Jarek