Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 229274

Re: Gemfire - SynchronizationCommitConflictException

$
0
0

Hi,

Thanks for help!

I need lock as there are more applications that want to modify the same key in the cache and only one is allowed to modify it at the same time.

What is your suggestion how the clients should connect to the cache?

 

I am using a getCache() method in my code the get the Region:

 

private synchronized Region getCache() {

   if (ThrottlingStorage.getCache() == null) {

      // getting the cache

      final ClientCache clientCache = new ClientCacheFactory().set("cache-xml-file", "gemfire-client.xml").create();

      AbstractStoredCache storedCache = new AbstractStoredCache() {

         @Override

         public void shutdown() {

            // TODO ???

         }

      };

      storedCache.setCache(clientCache);

      ThrottlingStorage.setCache(storedCache);

   }

   return ((ClientCache)ThrottlingStorage.getCache().getCache()).getRegion("THROTTLING");

}

 

The ThrottlingStorage is a ThreadLocal class.

Other question I don't know the answer how I should close the connection which was opened between the client and the cache...

 

Thanks,

V.


Viewing all articles
Browse latest Browse all 229274

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>