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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:23:43+00:00 2026-06-12T23:23:43+00:00

Here’s the background: I built a new WCF service which uses EF5 and was

  • 0

Here’s the background: I built a new WCF service which uses EF5 and was targeting .Net Framework 4.5. I’ve used code-first against an existing large legacy database. All was working nicely until I came to deploy the service to a test server, when I discovered the test server (and therefore the production server since they are the same build) was not capable of supporting Framework 4.5.

So, I downgraded the project to target Framework 4.0. After re-coding all my entity mappings (to avoid using code in the DataAnnotations.Schema namespace specific to 4.5), I had this working again locally. However, after deploying to the server I was hitting the error described here: Can anyone spot why I keep getting this error testing the EF 5 beta.

After doing as suggested – uninstalling and re-installing EF5 via NuGet, I am now getting a timeout error when trying to test the service.

Specifically the timeout occurs when attempting to execute the following Linq:

var games = from m in _db.Members
        join s in _db.UkSyndicates
            on m.MemberId equals s.MemberId
        where m.PaymentMethod == "Credit/Debit Card"
        && EntityFunctions.TruncateTime(s.NextChargeDate) <=  EntityFunctions.TruncateTime(DateTime.Now)
        && !string.IsNullOrEmpty(m.AibCustomerReference)
        && (m.StatusId == 105 || m.StatusId == 113)
        select new BillingItem
        {
            Id = s.Id,
            SyndicateId = s.SyndicateId,
            MemberId = s.MemberId,
            LastDrawId = s.LastDrawId,
            LastPaidGame = s.LastPaidGame,
            NextChargeDate = s.NextChargeDate,
            Protected = s.Protected,
            PaymentFrequency = (int)(s.PaymentFrequency*4),
            CurrencyCode = m.CurrencyCode,
            AibCustomerReference = m.AibCustomerReference,
            WeeklyFee = (from f in _db.GameFees where f.FeeName == "UK_LOTTO_FEE" && f.CurrencyCode == m.CurrencyCode select f.Amount).FirstOrDefault(),
            GameCode = game,
            PostCode = m.PostCode,
            CountryCode = m.CountryCode,
            EmailAddress = m.Email
        };

There may well be a more efficient way to write this query – I’m fairly inexperienced with Linq and EF, but I would stress this did NOT time-out prior to the uninstall and re-install of EF. In fact it returned data fairly quickly.

I can’t see any reason this would timeout after the re-install of EF, nothing in the code has changed, but need a solution to this fast!

Thanks.

To clarify the error I’m getting, it’s at the point that EF tries to execute the above query, I get an EntityCommandExecutionException thrown. The exception message is “An error occurred while executing the command definition. See the inner exception for details.” The inner exception is “Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.”

The stack trace is below:

at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption)
at System.Data.Objects.ObjectQuery1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Data.Entity.Internal.Linq.InternalQuery
1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
at RepeatBillingService.Repositories.BillingRepository.GetMembersForGame(String game, List
1& billingQ) in p:\Projects\BigFatLottos\RepeatBillingService\RepeatBillingService\Repositories\BillingRepository.cs:line 441
at RepeatBillingService.Repositories.BillingRepository.GetMemberGamesForBilling() in p:\Projects\BigFatLottos\RepeatBillingService\RepeatBillingService\Repositories\BillingRepository.cs:line 24
at RepeatBillingService.RepeatBillingService.RunRepeatBilling() in p:\Projects\BigFatLottos\RepeatBillingService\RepeatBillingService\RepeatBillingService.svc.cs:line 51
at SyncInvokeRunRepeatBilling(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)

  • 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-12T23:23:45+00:00Added an answer on June 12, 2026 at 11:23 pm

    I got to the bottom of this, and apologise as the whole question was a bit of a red herring. I’d had a SSMS session open in the background where I was tweaking the data for testing, and had been updating the “NextChargeDate” values. When I came to close down the session, I got “there are uncommitted transactions, do you want to commit now” which started alarm bells ringing.

    Sure enough on restarting the WCF service, everything worked perfectly. So my timeout was occurring because of uncommitted updates on that field in the DB – EF obviously couldn’t read the data successfully until the updates were committed.

    So my apologies for wasting your time with this question, just a simple oversight while working long hours under pressure to get a new system live.

    Thanks anyway for your responses.

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

Sidebar

Related Questions

Here is the code I'm using inside my AsyncTask DefaultHttpClient httpClient = new DefaultHttpClient();
Here is my problem. Our tech. writer or customer service will often create new
Here's the code require_once 'functions.php'; require_once 'cfg.php'; $mysqli = new mysqli($dbhost, $dbuser, $dbpass, $db);
Here is my code, which takes two version identifiers in the form 1, 5,
here is my code, SiteMember class @OneToMany(mappedBy = member,cascade=CascadeType.ALL) private List<MemberThread> memberThread = new
Here a simple question : What do you think of code which use try
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
I used javascript for loading a picture on my website depending on which small

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.