Hi, I believe you need synchronize that code piece if you have multiple client in different thread to handle the concurrent correctly. ------------- Freeman(Yue) Fang
Red Hat, Inc. FuseSource is now part of Red Hat Web: http://fusesource.com | http://www.redhat.com/ Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: @Freeman小屋 On 2013-9-6, at 下午4:46, Bin Zhu wrote: > Hi, > > For the cached wsdl in client side issue, the removeDefinition method works > in most cases in my testing. However, sometimes it failed, especially when > the server WSDL changes frequently and there are multiple client invoked > the web service. It seems the caches is not correctly removed as expected. > Any idea for the potential reason? Thanks in advance. > > bus.getExtension(WSDLManager.class).removeDefinition(bus. > getExtension(WSDLManager.class).getDefinition(url)); > > > 2013/8/20 Freeman Fang (JIRA) <[email protected]> > >> >> [ >> https://issues.apache.org/jira/browse/CXF-5216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13744765#comment-13744765] >> >> Freeman Fang commented on CXF-5216: >> ----------------------------------- >> >> Per Bin Zhu last reply in mail list, the solution here works for him so I >> will close this issue. >> >>> WSDL definition cache issue for web service client when WSDL in service >> war changed >>> >> ----------------------------------------------------------------------------------- >>> >>> Key: CXF-5216 >>> URL: https://issues.apache.org/jira/browse/CXF-5216 >>> Project: CXF >>> Issue Type: Bug >>> Affects Versions: 2.6.2 >>> Reporter: Bin Zhu >>> Assignee: Freeman Fang >>> Attachments: CXF-5216-2.patch, CXF-5216.patch >>> >>> >>> In current design, the WSDL definition will be cached in case the the >> same wsdl will be queried later.(WSDLManagerImpl.getDefinition) >>> e.g. >>> public Definition getDefinition(String url) throws WSDLException { >>> synchronized (definitionsMap) { >>> if (definitionsMap.containsKey(url)) { >>> return definitionsMap.get(url); >>> } >>> } >>> return loadDefinition(url); >>> } >>> The cache mechanism indeed improves the performance in most scenarios. >> But if the WSDL file in service provider app changed, the client will not >> get the correct WSDL definition even using retrieves the wsdl from server >> dynamically (http://hostname:portname/xxx?wsdl),unless restarting the >> client app. >>> It would be more reasonable to introduce a client property to allow user >> to disable the definition cache so that they can choose if they get WSDL >> definition from cache or the URL dynamically for their scenarios. Any >> thoughts? Thanks. >> >> -- >> This message is automatically generated by JIRA. >> If you think it was sent incorrectly, please contact your JIRA >> administrators >> For more information on JIRA, see: http://www.atlassian.com/software/jira >>
