<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 27, 2017 at 9:55 AM Dan Berindei <<a href="mailto:dan.berindei@gmail.com">dan.berindei@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would go for option 2.<br class="gmail_msg"></blockquote><div><br></div><div>Do you think a WARN message will be enough? I am a bit weary about this option myself.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
We already started disconnecting the cache definition and retrieval,<br class="gmail_msg">
at least `getCache(name)` doesn't define a new cache based on the<br class="gmail_msg">
default configuration any more. So I don't think it would be too much,<br class="gmail_msg">
even at this point, to deprecate all the overloads of `getCache` that<br class="gmail_msg">
can define a new cache and advise users to use `defineConfiguration`<br class="gmail_msg">
instead.<br class="gmail_msg"></blockquote><div><br></div><div>Hrmm I like the idea of deprecating the overloads :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Cheers<br class="gmail_msg">
Dan<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
On Mon, Feb 27, 2017 at 4:31 PM, William Burns <<a href="mailto:mudokonman@gmail.com" class="gmail_msg" target="_blank">mudokonman@gmail.com</a>> wrote:<br class="gmail_msg">
> When working on another project using Infinispan the code being used was a<br class="gmail_msg">
> bit interesting and I don't think our template configuration handling was<br class="gmail_msg">
> expecting it do so in such a way.<br class="gmail_msg">
><br class="gmail_msg">
> Essentially the code defined a template for a distributed cache as well as<br class="gmail_msg">
> some named caches. Then whenever a cache is retrieved it would pass the<br class="gmail_msg">
> given name and always the distributed cache template. Unfortunately with<br class="gmail_msg">
> the way templates work they essentially redefine a cache first so the actual<br class="gmail_msg">
> cache configuration was wiped out. In this example I was able to get the<br class="gmail_msg">
> code to change to using a default cache instead, which is the behavior that<br class="gmail_msg">
> is needed.<br class="gmail_msg">
><br class="gmail_msg">
> The issue though at hand is whether we should allow a user to call getCache<br class="gmail_msg">
> in such a way. My initial thought is to have it throw some sort of<br class="gmail_msg">
> configuration exception when this is invoked. But there are some possible<br class="gmail_msg">
> options.<br class="gmail_msg">
><br class="gmail_msg">
> 1. Throw a configuration exception not allowing a user to use a template<br class="gmail_msg">
> with an already defined cache. This has a slight disconnect between<br class="gmail_msg">
> configuration and runtime, since if a user adds a new definition it could<br class="gmail_msg">
> cause runtime issues.<br class="gmail_msg">
> 2. Log an error/warning message when this occurs. Is this enough though?<br class="gmail_msg">
> Still could have runtime issues that are possibly undetected.<br class="gmail_msg">
> 3. Merge the configurations together applying the template first. This<br class="gmail_msg">
> would be akin to how default cache works currently, but you would get to<br class="gmail_msg">
> define your default template configuration at runtime. This sounded like the<br class="gmail_msg">
> best option to me, but the problem is what if someone calls getCache using<br class="gmail_msg">
> the same cache name but a different template. This could get hairy as well.<br class="gmail_msg">
><br class="gmail_msg">
> Really thinking about the future, disconnecting the cache definition and<br class="gmail_msg">
> retrieval would be the best option, but we can't do that this late in the<br class="gmail_msg">
> game.<br class="gmail_msg">
><br class="gmail_msg">
> What do you guys think?<br class="gmail_msg">
><br class="gmail_msg">
> - Will<br class="gmail_msg">
><br class="gmail_msg">
> _______________________________________________<br class="gmail_msg">
> infinispan-dev mailing list<br class="gmail_msg">
> <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
> <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
infinispan-dev mailing list<br class="gmail_msg">
<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
</blockquote></div></div>