You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Shawn Castrianni <Sh...@halliburton.com> on 2008/02/24 19:08:37 UTC

cache settings

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?

---
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.

Re: cache settings

Posted by Xavier Hanin <xa...@gmail.com>.
On Sun, Feb 24, 2008 at 7:08 PM, Shawn Castrianni <
Shawn.Castrianni@halliburton.com> 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/