On Sun, Feb 24, 2008 at 7:08 PM, Shawn Castrianni < [EMAIL PROTECTED]> wrote:
> The cache documentation says not to use the same resolution cache at the > same time, "should never be used by multiple processes at the same time" > > On an automated build server, I can see that this could easily happen. > Therefore, I am thinking I need to specify the defaultCache directory on > the settings tag to use different cache dirs for each build. The best way > to do that is to the use build number in the defaultCache value. However, > in order to get the buildnumber, you have to call buildnumber which requires > the settings to be loaded and a cache to be used. > > I am stuck with a chicken and egg problem. How do I differentiate my > caches so that the resolution cache isn't used more by multiple processes at > the same time? Using build number wouldn't be a solution anyway, since buildnumber is not thread safe. I suggest using a process id, or a thread id, or a timestamp, or a combination of them, depending on how robust you want your system and what you do with this cache after the run. Xavier > > --- > Shawn Castrianni > > ---------------------------------------------------------------------- > This e-mail, including any attached files, may contain confidential and > privileged information for the sole use of the intended recipient. Any > review, use, distribution, or disclosure by others is strictly prohibited. > If you are not the intended recipient (or authorized to receive information > for the intended recipient), please contact the sender by reply e-mail and > delete all copies of this message. -- Xavier Hanin - Independent Java Consultant http://xhab.blogspot.com/ http://ant.apache.org/ivy/ http://www.xoocode.org/
