Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9178133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:28:53+00:00 2026-06-17T17:28:53+00:00

in Windows Azure Shared Cache: suppose I do the following: try { mCache.Remove(key); Trace.WriteLine(removed

  • 0

in Windows Azure Shared Cache:
suppose I do the following:

try
{
  mCache.Remove(key);
  Trace.WriteLine("removed successfully from Azure Shared Cache");
}
catch (DataCacheException e)
{
  WorkerRole.log.Info(e.ToString());
}

is it right to say that if the code reached to the Trace.WriteLine command, then the operation completed successfully? (otherwise, it would be throwing DataCacheException.

I know I can register to the event CacheOperationCompleted, but is my code can be a good alternative to test operation success? (for Put/Remove methods).

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:28:54+00:00Added an answer on June 17, 2026 at 5:28 pm

    Remove method returns boolean flag indicating whether an item identified by the given keyhas been removed (true) or not (false).

    So if you want to check operation result I would suggest following approach:

    if(mCache.Remove(key))
    {
        Trace.WriteLine("removed successfully from Azure Shared Cache");
    }
    

    As far as Put method is concerned, this might be a bit more complicated.

    Basically, if your cache.Put(key, value) method completes successfully (no exceptions), you can assume your item has been added to your cache.

    However, Azure cache items can be evicted from the cache (that depends on the cache size and item expiration time – default item expiration time is 48 hours for shared caching)

    So in order to avoid any “surprises” I would recommend cache usage pattern as follows:

    • Get item from cache by a key
    • If cache return Null then create that item and put it into the cache
    • Perform operation on the item

    Also as a side note, I would recommend using in-role caching instead of shared caching service (mostly because it is cheaper, has more features etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I create a Windows Azure application that consists of multiple instances talking to
Configuration the ASP.NET Output Cache Provider for Windows Azure Caching I'm a bit confuse
I have two websites that are both running in shared mode in Windows Azure.
When a Windows Azure worker role instance is rebooted from within the Azure portal,
I have a server running on Windows Azure here with a large key (link
Using http://docs.orchardproject.net/Documentation/Deploying-Orchard-to-Windows-Azure I've successfully deployed Orchard into Azure. After every 20mins or so without
I'm migrating (sigh) Windows Azure from 1.7 to version 2, and I'm now facing
I've added the Windows Azure Cache 1.8.0 nuget package to my solution, but it
I'm trying to use WindowsAzure shared cache and the Increment operator of the DataCache
Windows Azure Data Services supports a subset of TSQL. What are the features of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.