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

  • Home
  • SEARCH
  • 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 588489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:19:25+00:00 2026-05-13T15:19:25+00:00

I have had a problem where it appeared as though the second execution of

  • 0

I have had a problem where it appeared as though the second execution of a stored procedure was being ignored.

The first time I call my stored procedure it found 20 records and extracted information for the date range August 2009. The first line was meter id 233 with a data value 200

I then called the stored procedure and 20 records were also returned. This time meter id 233 had a data value of 300.

Linq is detecting that meterid 233 already exists in the context and so doesnt update

I am sure this is something to do with ObjectTrackingEnabled but this does not seem to be available for me to set to false?

I didnt write the context code so I dont really know how it all works, but I have noticed that it seems to inherit from ObjectDataContext

This was generate using Entity Framework and VS 2008

namespace DataServiceDAL
{

/// <summary>
/// There are no comments for dbChildDataContext in the schema.
/// </summary>
public partial class dbChildDataContext : global::System.Data.Objects.ObjectContext
{
    /// <summary>
    /// Initializes a new dbChildDataContext object using the connection string found in the 'dbChildDataContext' section of the application configuration file.
    /// </summary>
    public dbChildDataContext() : 
            base("name=dbChildDataContext", "dbChildDataContext")
    {
        this.OnContextCreated();            
    }
    /// <summary>
    /// Initialize a new dbChildDataContext object.
    /// </summary>
    public dbChildDataContext(string connectionString) : 
            base(connectionString, "dbChildDataContext")
    {
        this.OnContextCreated();
    }
    /// <summary>
    /// Initialize a new dbChildDataContext object.
    /// </summary>
    public dbChildDataContext(global::System.Data.EntityClient.EntityConnection connection) : 
            base(connection, "dbChildDataContext")
    {
        this.OnContextCreated();
    }
    partial void OnContextCreated();

…………..
}

I use the following linq to extract the data

    public static List<MeterTotalConsumpRecord> GetTotalAllTimesConsumption(DateTime dtStart, DateTime dtEnd, EUtilityGroup ug, int nMeterSelectionType, int nCustomerID, 
        int nUserID, string strSelection, bool bClosedLocations, bool bDisposedLocations)
    {    
        dbChildDataContext db = DBManager.ChildDataConext(nCustomerID);

        var tbl = from t in db.GetTotalConsumptionByMeter(dtStart, dtEnd, (int) ug, nMeterSelectionType, nCustomerID, nUserID, strSelection, bClosedLocations, bDisposedLocations, 1)                       
                  select t;                        

        return tbl.ToList();            
    }

I need a way of clearing this cache out so that the objects are updated properly or I need a way of refreshing the objects

Can anyone help?

Cheers

Paul

  • 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-05-13T15:19:25+00:00Added an answer on May 13, 2026 at 3:19 pm

    We recommend you to refresh objects using MergeOption.
    Here is a simple example:

    var query = from d in context.Depts
                       where d.Deptno < 50
                       select d;
    (query as ObjectQuery).MergeOption = MergeOption.OverwriteChanges;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 288k
  • Answers 288k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Unless the Object class is not actually the java.lang.Object class… May 13, 2026 at 5:26 pm
  • Editorial Team
    Editorial Team added an answer The tag on its own shouldn't, but be wary if… May 13, 2026 at 5:26 pm
  • Editorial Team
    Editorial Team added an answer sorted(array, key=lambda x:x[:24]) Example: >>> a = ["wxyz", "abce", "abcd",… May 13, 2026 at 5:26 pm

Related Questions

I've set hibernate.generate_statistics=true and now need to register the mbeans so I can see
We had a line of code if( !CreateFile( m_hFile, szFile, GENERIC_READ|GENERIC_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL
Ok, I had a simple layout problem a week or two ago. Namely sections
When writing to a text file, some of the file.write instances are followed by
Outline I'm building a form for a specific page, where users can make suggestions

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.