]
Work on ISPN-9163 stopped by Radoslav Husar.
--------------------------------------------
RemoteCacheManagerAdmin#getOrCreateCache(...) fails to return an
existing cache in case the template does not exist
-------------------------------------------------------------------------------------------------------------------
Key: ISPN-9163
URL:
https://issues.jboss.org/browse/ISPN-9163
Project: Infinispan
Issue Type: Bug
Components: Hot Rod
Affects Versions: 9.2.3.Final, 9.3.0.Beta1
Reporter: Radoslav Husar
Assignee: Radoslav Husar
Priority: Major
{{RemoteCacheManagerAdmin#getOrCreateCache(...)}} fails to return an existing cache in
case the template does not exist. This is because
{{org.infinispan.globalstate.impl.GlobalConfigurationManagerImpl#getOrCreateCache}} first
obtains the cache configuration and only then gets the cache.
While it could be argued, that this is by design, this does not seem practical but mainly
violates the API contract defined by JavaDoc:
{code:java}
/**
* Retrieves a an existing cache on the remote server cluster. If it doesn't
exist, it will be created using the
* specified template.
*
* @param name the name of the cache to create
* @param template the template to use for the cache. If null, the configuration
marked as default on the server
* will be used
* @return the cache
* @throws HotRodClientException
*/
@Override
<K, V> RemoteCache<K, V> getOrCreateCache(String name, String template)
throws HotRodClientException;
{code}