Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.CARNet.hr!gregory.BNet.hr!not-for-mail From: Josip Almasi Newsgroups: comp.lang.java.programmer Subject: Re: share data between two tomcat contexts? Date: Sat, 17 May 2014 09:29:48 +0200 Organization: B.net Hrvatska d.o.o. Lines: 29 Message-ID: References: NNTP-Posting-Host: cpe-94-253-152-127.zg.cable.xnet.hr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: gregory.bnet.hr 1400311789 17917 94.253.152.127 (17 May 2014 07:29:49 GMT) X-Complaints-To: abuse@globalnet.hr NNTP-Posting-Date: Sat, 17 May 2014 07:29:49 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:28510 On 05/17/2014 02:19 AM, Laura Schmidt wrote: > On 05/17/2014 01:41 AM, markspace wrote: >> On 5/16/2014 4:32 PM, Laura Schmidt wrote: > >>> Are there any solutions? > >> At this point consider using your own server. > > Ok, but how would this work over time? > > Assume an app "FirstApp". What would I insert into the server.xml? > > And then, what happens, when I update the app, e. g. undeploy and > redeploy it? There will be a time span where server.xml references to an > app that does not exist? I suppose so. Now that I've looked at the article (interesting one, thanks!), caller app may fail when context is unavailable during redeployment, in a number of ways. Also, redeployment of called app might delay, maybe even fail, for caller app keeps reference to called classloader. So it's up to you to make that time span shorter - don't store references to called context and classloader and object and methods anywhere, so they become unreachable as soon as possible. Reflection calls are never cached, you'll always get references to fresh classes, objects and methods. Regards...