<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 27, 2017 at 9:55 AM Dan Berindei &lt;<a href="mailto:dan.berindei@gmail.com">dan.berindei@gmail.com</a>&gt; 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&#39;t define a new cache based on the<br class="gmail_msg">
default configuration any more. So I don&#39;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 &lt;<a href="mailto:mudokonman@gmail.com" class="gmail_msg" target="_blank">mudokonman@gmail.com</a>&gt; wrote:<br class="gmail_msg">
&gt; When working on another project using Infinispan the code being used was a<br class="gmail_msg">
&gt; bit interesting and I don&#39;t think our template configuration handling was<br class="gmail_msg">
&gt; expecting it do so in such a way.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Essentially the code defined a template for a distributed cache as well as<br class="gmail_msg">
&gt; some named caches.  Then whenever a cache is retrieved it would pass the<br class="gmail_msg">
&gt; given name and always the distributed cache template.  Unfortunately with<br class="gmail_msg">
&gt; the way templates work they essentially redefine a cache first so the actual<br class="gmail_msg">
&gt; cache configuration was wiped out.  In this example I was able to get the<br class="gmail_msg">
&gt; code to change to using a default cache instead, which is the behavior that<br class="gmail_msg">
&gt; is needed.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; The issue though at hand is whether we should allow a user to call getCache<br class="gmail_msg">
&gt; in such a way. My initial thought is to have it throw some sort of<br class="gmail_msg">
&gt; configuration exception when this is invoked. But there are some possible<br class="gmail_msg">
&gt; options.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; 1. Throw a configuration exception not allowing a user to use a template<br class="gmail_msg">
&gt; with an already defined cache. This has a slight disconnect between<br class="gmail_msg">
&gt; configuration and runtime, since if a user adds a new definition it could<br class="gmail_msg">
&gt; cause runtime issues.<br class="gmail_msg">
&gt; 2. Log an error/warning message when this occurs. Is this enough though?<br class="gmail_msg">
&gt; Still could have runtime issues that are possibly undetected.<br class="gmail_msg">
&gt; 3. Merge the configurations together applying the template first.  This<br class="gmail_msg">
&gt; would be akin to how default cache works currently, but you would get to<br class="gmail_msg">
&gt; define your default template configuration at runtime. This sounded like the<br class="gmail_msg">
&gt; best option to me, but the problem is what if someone calls getCache using<br class="gmail_msg">
&gt; the same cache name but a different template. This could get hairy as well.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Really thinking about the future, disconnecting the cache definition and<br class="gmail_msg">
&gt; retrieval would be the best option, but we can&#39;t do that this late in the<br class="gmail_msg">
&gt; game.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; What do you guys think?<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;  - Will<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; _______________________________________________<br class="gmail_msg">
&gt; infinispan-dev mailing list<br class="gmail_msg">
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt; <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>