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 8805991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:00:20+00:00 2026-06-14T02:00:20+00:00

I have web app which invokes OData Webservice ( DataServiceContext ) via a proxy.

  • 0

I have web app which invokes OData Webservice (DataServiceContext) via a proxy. The issue is the code even though makes a call to OData webservice every time, it always returns old data after changing content in the Content Management system (SDL Tridion).

string getPageContentForUrl(string url)
{
    var page = cdService
                   .Pages
                   .Expand("PageContent")
                   .Where(x => x.Url == url)
                   .FirstOrDefault();

    if (page == null || page.PageContent == null)
    {
        return string.Empty;
    }
    else
    {
        return page.PageContent.Content;
    }

}

We had to an reset the apppool to see the latest data changes.

So while debugging more, I noticed that

var context = (System.Data.Services.Client.DataServiceContext)cdService;
context.Entities[0].State = Unchanged

so I tried fixing it by calling .Detach() explicitly before returning the value from getPageContentForUrl, so something like,

cdService.Detach(page);
cdService.Detach(page.PageContent);

My question is, can I do the above at more “global” level, maybe have webservice always assume the State as “Changed”, since I don’t want to manually write code to Detach()?

  • 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-14T02:00:21+00:00Added an answer on June 14, 2026 at 2:00 am

    I think the answer lies indeed – as you suspected – in the proxy you’re using, or rather in the DataServiceContext. This is what Microsoft has to say:

    By default, the client only materializes an entry in the response feed
    into an object for entities that are not already being tracked by the
    DataServiceContext. This means that changes to objects already in the
    cache are not overwritten. This behavior is controlled by specifying a
    MergeOption value for queries and load operations.

    To me, this sounds exactly like the behaviour that you’re describing. Fortunately, the caching can be turned off by setting the MergeOption property on the DataServiceContext.

    See http://msdn.microsoft.com/en-us/library/gg602811.aspx.

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

Sidebar

Related Questions

I have a web app in Java, which uses some external program (invokes a
I have a web app which lets the user select the excel spreadsheet and
I have a Flash web app which displays user submitted PNG files. Files are
I have a Silverlight web app which uses ASP.net Website administration tool for user
Have an ASP.net web app which works fine for a few days, but then
The thing I have a web app (asp.net) which needs to have a feed.
I have a user profile page on my web app which has contact information.
I have a web app (.NET 3.5) which is sending notifications by email to
I have a app which will download a file from web. The download action
In my web app I have a line which looks like this: small textbox

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.