Page 1 of 1

Gold R6 guest checkout errors

Posted: Tue Jun 03, 2014 4:14 am
by AbleMods
We are consistently seeing these errors when Guest Checkout is enabled. We've disabled it for now, but need to know if there's a solution. Same error, same SQL command. Multiple times through the evening.

Any suggestions?
2014-06-02 21:40:06,663 ERROR AbleCommerce An error has occured at https://<website>/Checkout/EditBillAddress.aspx?GC=0
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> NHibernate.Exceptions.GenericADOException: could not execute native bulk manipulation query:update ac_OrderNotes set UserId = :newUserId where UserId = :oldUserId[SQL: update ac_OrderNotes set UserId = @p0 where UserId = @p1] ---> System.Data.SqlClient.SqlException: Transaction (Process ID 88) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
at NHibernate.Engine.Query.NativeSQLQueryPlan.PerformExecuteUpdate(QueryParameters queryParameters, ISessionImplementor session)
--- End of inner exception stack trace ---
at NHibernate.Engine.Query.NativeSQLQueryPlan.PerformExecuteUpdate(QueryParameters queryParameters, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.ExecuteNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters)
at NHibernate.Impl.SqlQueryImpl.ExecuteUpdate()
at CommerceBuilder.Orders.OrderRepository.UpdateUser(Int32 oldUserId, Int32 newUserId)
at CommerceBuilder.Users.User.Migrate(User oldUser, User newUser, Boolean includeOrderData, Boolean isNewUserAccount)
at AbleCommerce.Checkout.EditBillAddress.BillingPageContinue_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Re: Gold R6 guest checkout errors

Posted: Tue Jun 03, 2014 7:06 am
by mazhar
Is there any custom modification which involves order notes on that page ?

Re: Gold R6 guest checkout errors

Posted: Tue Jun 03, 2014 7:10 am
by AbleMods
No, the file is identical to the R6 release file.

No customizations to ordernotes anywhere in this install.

Re: Gold R6 guest checkout errors

Posted: Wed Sep 24, 2014 5:35 am
by roadkill
any suggestions???

Re: Gold R6 guest checkout errors

Posted: Thu Sep 25, 2014 4:57 am
by mazhar
I was not able to reproduce the issue on R6. You can try following change though and hopefully it will skip the routine creating trouble. The exception details suggest it happens while executing queries for orders during user migration. I think we shouldn't try to migrate orders for anonymous user since they can't have any order unless they do a guest checkout firsts, in which case user will be guest user not anonymous.

In Website/Checkout/EditBillAddress.aspx.cs file locate following code

Code: Select all

CommerceBuilder.Users.User.Migrate(oldUser, newUser, true, true);
and replace it with

Code: Select all

CommerceBuilder.Users.User.Migrate(oldUser, newUser, false, true);
Save the change and see if it solves the problem.