ChildDataPortal.Update failed on the server

ChildDataPortal.Update failed on the server

Old forum URL: forums.lhotka.net/forums/t/8476.aspx


Niamh posted on Thursday, February 04, 2010

Hi,

Recently we started experiencing the above error on our live system. It has been in production since August but only started appearing since last Monday even though there were no code changes. I have not been able to reproduce it in test or dev and most of the time it works correctly in production.

There is no error the application log in the event viewer.

Once it appears once it seems to happen for all users for around 20 minutes regardless if they restart the app or we recycle IIS. Then for no apparent reason it can just stop happening and be fine again.

We thought it may have been related to the transaction timing out but the users have informed us it takes only seconds from when the button is clicked to when the error is displayed.

Any ideas would be greatly appreciated. Smile [:)]

Thanks in advance,

Niamh

 

The code is called here

DataPortal.UpdateChild(ReadProperty<PackTrackings>(PackTrackingsProperty), this);

DataPortal.UpdateChild(ReadProperty<DeedGridRefs>(DeedGridRefsProperty), this);

 

private void Child_Update(Account parent)

{

bool cancel = false;

OnPackTrackingUpdating(parent, ref cancel);

if (cancel) return;

ExecuteUpsert(parent);

OnPackTrackingUpdated();

}

protected virtual void ExecuteUpsert(Account parent)

{

using (var mgr = ContextManager<InDeed.DalLinq.InDeedDBDataContext>

.GetManager(InDeed.DalLinq.Database.InDeedDB))

{

int? id = _id;

System.Data.Linq.Binary _tempTimestamp;

if (_audTimestamp == null)

_tempTimestamp = new System.Data.Linq.Binary(new byte[] { });

else

_tempTimestamp = new System.Data.Linq.Binary(_audTimestamp);

_accountID = parent.Id;

if (IsSelfDirty) _audUserID = parent.AudUserID;

mgr.DataContext.PackTrackingUpsert

(

_accountID,

_packTypeID,

_statusDate,

_statusID,

ArgumentHelper.NullableValue(_outLocationID),

ArgumentHelper.NullableValue(_trackingStatusID),

ArgumentHelper.NullableValue(_outTypeID),

ArgumentHelper.NullableValue(_requestID),

ArgumentHelper.NullableValue(_receiptDate),

ArgumentHelper.NullableValue(_retrievalDate),

ArgumentHelper.NullableValue(_dueDate),

ArgumentHelper.NullableValue(_comment),

ArgumentHelper.NullableValue(_assignedTo),

_active,

_audUserID,

ref _tempTimestamp,

ref id

);

_id = System.Convert.ToInt32(id);

_audTimestamp = _tempTimestamp.ToArray();

}

}

 

private void Child_Update(Account parent)

{

bool cancel = false;

OnDeedGridRefUpdating(parent, ref cancel);

if (cancel) return;

ExecuteUpsert(parent);

OnDeedGridRefUpdated();

}

 

protected virtual void ExecuteUpsert(Account parent)

{

using (var mgr = ContextManager<InDeed.DalLinq.InDeedDBDataContext>

.GetManager(InDeed.DalLinq.Database.InDeedDB))

{

int? id = _id;

System.Data.Linq.Binary _tempTimestamp;

if (_audTimestamp == null)

_tempTimestamp = new System.Data.Linq.Binary(new byte[] { });

else

_tempTimestamp = new System.Data.Linq.Binary(_audTimestamp);

_accountID = parent.Id;

if (IsSelfDirty) _audUserID = parent.AudUserID;

mgr.DataContext.DeedGridRefUpsert

(

_accountID,

ArgumentHelper.NullableValue(_bay),

ArgumentHelper.NullableValue(_columnID),

ArgumentHelper.NullableValue(_shelf),

ArgumentHelper.NullableValue(_position),

_active,

_audUserID,

ref _tempTimestamp,

ref id

);

_id = System.Convert.ToInt32(id);

_audTimestamp = _tempTimestamp.ToArray();

}

}

RockfordLhotka replied on Thursday, February 04, 2010

Do you have the actual exception and stack trace? It is hard to even know where to start without knowing the nature of the problem.

Niamh replied on Thursday, February 04, 2010

Thanks for your swift reply,

We dont have a stacktrace for the error that is experienced in production. Normally errors are logged to the database along with the stacktrace but for some reason these errors arent getting logged.

I can reproduce the same error message in dev by stopping the code (in the same place as the live error) for longer than a minute and then continuing (i.e. allowing the transaction to timeout), but this doesnt appear to be the same issue as the users see it throwing the error within seconds of clicking the button.

The intermittent nature of the error is making it very difficult to narrow down. I downloaded the CSLA source and referenced that in my solution.

 

The call stack from when I try and reproduce the error by allowing the transaction to timeout is below if it is of any use.

 

> Csla.DLL!Csla.Server.SimpleDataPortal.Update(object obj = {11936}, Csla.Server.DataPortalContext context = {Csla.Server.DataPortalContext}) Line 247 C#
  Csla.DLL!Csla.Server.TransactionalDataPortal.Update(object obj = {11936}, Csla.Server.DataPortalContext context = {Csla.Server.DataPortalContext}) Line 90 + 0x10 bytes C#
  Csla.DLL!Csla.Server.DataPortal.Update(object obj = {11936}, Csla.Server.DataPortalContext context = {Csla.Server.DataPortalContext}) Line 194 + 0xf bytes C#
  Csla.DLL!Csla.DataPortalClient.LocalProxy.Update(object obj = {11936}, Csla.Server.DataPortalContext context = {Csla.Server.DataPortalContext}) Line 55 + 0x18 bytes C#
  Csla.DLL!Csla.DataPortal.Update(object obj = {11936}) Line 415 + 0x18 bytes C#
  Csla.DLL!Csla.DataPortal.Update<Csla.BusinessBase<PTSB.InDeed.BusinessEntities.Account>>(Csla.BusinessBase<PTSB.InDeed.BusinessEntities.Account> obj = {11936}) Line 322 + 0x9 bytes C#
  Csla.DLL!Csla.BusinessBase<PTSB.InDeed.BusinessEntities.Account>.Save() Line 119 + 0x46 bytes C#
  PTSB.InDeed.BusinessEntities.DLL!PTSB.InDeed.BusinessEntities.Account.Save() Line 1405 + 0x8 bytes C#
  CSF.DLL!CSF.Common.Functions.Save<PTSB.InDeed.BusinessEntities.Account>(PTSB.InDeed.BusinessEntities.Account t, CSF.Common.BusinessParameters parameters, bool forceUpdate) + 0x62 bytes
  PTSB.InDeed.Services.DLL!PTSB.InDeed.Services.AccountService.SaveAccount(PTSB.InDeed.BusinessEntities.Account account = {11936}) Line 115 + 0x76 bytes C#
  PTSB.InDeed.Services.DLL!PTSB.InDeed.Services.WorkflowService.CheckInDeedCommit(PTSB.InDeed.BusinessEntities.DataTransferObjects.WorkflowDeedInformation info = {PTSB.InDeed.BusinessEntities.DataTransferObjects.WorkflowDeedInformation}) Line 1200 + 0x40 bytes C#
  PTSB.InDeed.Modules.Deeds.DLL!PTSB.InDeed.Modules.Deeds.Views.CheckInPresenter.OnSave() Line 189 + 0xf bytes Basic
  App_Web_2dyvekge.dll!PTSB.InDeed.Modules.Deeds.Views.CheckIn.CheckOutWizard_FinishButtonClick(Object sender = {System.Web.UI.WebControls.Wizard}, System.Web.UI.WebControls.WizardNavigationEventArgs e = {System.Web.UI.WebControls.WizardNavigationEventArgs}) Line 136 + 0x11 bytes Basic
  System.Web.dll!System.Web.UI.WebControls.Wizard.OnFinishButtonClick(System.Web.UI.WebControls.WizardNavigationEventArgs e) + 0x6d bytes
  System.Web.dll!System.Web.UI.WebControls.Wizard.OnBubbleEvent(object source, System.EventArgs e) + 0x282 bytes
  System.Web.dll!System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(object source, System.EventArgs args) + 0x14 bytes
  System.Web.dll!System.Web.UI.Control.RaiseBubbleEvent(object source = {Text = "Complete Check In"}, System.EventArgs args = {System.Web.UI.WebControls.CommandEventArgs}) + 0x26 bytes
  System.Web.dll!System.Web.UI.WebControls.Button.OnCommand(System.Web.UI.WebControls.CommandEventArgs e) + 0x77 bytes
  System.Web.dll!System.Web.UI.WebControls.Button.RaisePostBackEvent(string eventArgument) + 0xa7 bytes
  System.Web.dll!System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + 0xb bytes
  System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Web.UI.IPostBackEventHandler sourceControl, string eventArgument) + 0xe bytes
  System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Collections.Specialized.NameValueCollection postData) + 0x25 bytes
  System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint = true) + 0x61e bytes
  System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint = true) + 0x84 bytes
  System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x51 bytes
  System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x16 bytes
  System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 bytes
  App_Web_2dyvekge.dll!ASP.deeds_checkin_checkin_aspx.ProcessRequest(System.Web.HttpContext context = {System.Web.HttpContext}) + 0x26 bytes
  System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0xb6 bytes
  System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0x4c bytes
  System.Web.dll!System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(System.Exception error) + 0x133 bytes
  System.Web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) + 0x7c bytes
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr = {System.Web.Hosting.ISAPIWorkerRequestOutOfProc}) + 0x17c bytes
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr) + 0x63 bytes
  System.Web.dll!System.Web.Hosting.ISAPIRuntime.ProcessRequest(System.IntPtr ecb, int iWRType) + 0x11c bytes
  [Appdomain Transition]
  [Native to Managed Transition]

Niamh replied on Friday, February 05, 2010

We managed to track down and fix this error. The root cause turned out to be a data integrity issue.

The difficulty in solving it was that the stacktrace with the error was hidden as it was caught first by a dll written by a 3rd party which we dont have access to and by the time it got to our application the specific error was lost.

 

RockfordLhotka replied on Friday, February 05, 2010

I'm glad you were able to resolve the issue!

Copyright (c) Marimer LLC