This way you will not know who exactly created the cache. As a result you cannot be certain whether your call to getOrCreateCache() created a cache or you just received already existing instance.
On Fri, Aug 14, 2015 at 8:55 AM, Alexey Kuznetsov <akuznet...@gridgain.com> wrote: > Or we could have isCreated() property on cache itself. > > On Fri, Aug 14, 2015 at 12:03 PM, Vladimir Ozerov <voze...@gridgain.com> > wrote: > > > May be we can return not only cache instance, but also a boolean defining > > whether a cache was created by this call or not? > > E.g.: > > > > IgniteCache getOrCreateCache(...); > > > > IgniteCache getOrCreateCache(..., CacheCreateResult); > > > > class CacheCreateResult { > > boolean isCreated(); > > } > > > > On Fri, Aug 14, 2015 at 3:56 AM, Alexey Goncharuk < > > alexey.goncha...@gmail.com> wrote: > > > > > In this case, since user called getOrCreateCache(), Ignite did not > > create a > > > cache because it already existed and also did not throw an exception > > > because method should return existing cache if a cache with the same > name > > > already exists. > > > > > > We may want to implement a check to verify that cache configurations > > match, > > > but I have no idea how to compare cache configurations given that they > > may > > > contain user-defined objects, such as store factories. > > > > > > 2015-08-12 9:45 GMT-07:00 Dmitriy Setrakyan <dsetrak...@apache.org>: > > > > > > > Igniters, > > > > > > > > After looking at the comment in the IGNITE-1240 [1], I got confused > on > > > how > > > > Ignite configuration works. It seems to me that we have a big > usability > > > > issue there. > > > > > > > > For example, can someone tell me what happens now if a user provides > > the > > > > configuration in an XML file and then also specifies the > configuration > > in > > > > code? > > > > > > > > [1] https://issues.apache.org/jira/browse/IGNITE-1240 > > > > > > > > Thanks, > > > > D. > > > > > > > > > > > > > -- > Alexey Kuznetsov > GridGain Systems > www.gridgain.com >