0

I have a strange error happening, the error seems to happen in my production environment but I cannot recreate the error locally through my WCF test client.

After I execute the Linq query

var isMember = db.DN2_Member.Where(m =>
                                m.Partner_Contract_Nbr.ToLower() == member.DentalMemberId.ToLower()
                                && m.Mbr_First_Nm.ToLower() == member.DentalMemberFirstName.ToLower()
                                //&& m.Mbr_Mid_Nm.ToLower().Trim() == memberMiddleName.ToLower()
                                && m.Mbr_Last_Nm.ToLower() == member.DentalMemberLastName.ToLower()
                                && m.DW_Rec_End_Dt == null 
                                && m.Mbr_Suc_Title == membersuffix.ToLower().Replace(".", ""));

var memberList = isMember.ToList();

I get an exception through my logger reflecting this:

2015-10-27 08:28:06,471 - WARN  -    at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass3.<GetResults>b__1()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at DentalTHSEnrollmentService.WebHost.THSService.GetMember(DentalMember member) in e:\GoAgent\pipelines\DentalTHSEnrollmentService_Master\product\app\DentalTHSEnrollmentService.WebHost\THSService.svc.cs:line 86

Line 86 is when i call ToList on the query. Once again this only occurs in production and I cannot recreate the error locally therefore, I am having trouble thinking about my next step.

Any advice would be much appreciated.

Also if i am correct toLower and Replace functions are evaluated before the sql query is built therefore, I believe it is valid and the error only happens on a few occasions.

5
  • 1
    What exception do you get?
    – Raidri
    Oct 28, 2015 at 15:39
  • hmm logger did not send that info over, must need to do more investigating to figure this out. Its challenging for me because I cannot get this exception to recreate and I would have to modify the logger in production which requires creating tickets to make changes to production and so forth. Is there not a good description of whats occurring here?
    – devzim
    Oct 28, 2015 at 15:45
  • See this question. It might help you out. It points out that it may be a mismatch between your development/local schema and your production/server schema.
    – Mike Hofer
    Oct 28, 2015 at 15:55
  • My local machine is using the same database as production for the lookup, therefore can not see this as a problem
    – devzim
    Oct 28, 2015 at 15:58
  • 1
    You might want to at least get that process rolling to update the logger. A stack track without an exception isn't the most useful thing in the world. Oct 28, 2015 at 15:59

1 Answer 1

0

It could be a deadlock, a database timeout, or a dropped connection. It could also be out of memory, thread terminated, or any number of other issues.

I'd throw ELMAH up on your production site and have it log the errors for you, which will log the exception and stack trace.

1
  • Right my next step is to modify the logger because its impossible to tell whats going on here when I cant recreate the error. Thanks for the advice. I believe we are using LogforNet for the logger
    – devzim
    Oct 28, 2015 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.