Hopefully someone on here can give me some guidance to get me on the right path....
I'm getting a cast exception during the Checkout method of the Basket object. The error is occurring during some internal sorting when Able is attempting to sort the OrderItems, unable to cast _something_ as an int.
Can anyone internal tell me what is going on in this method that would cause this? I'm sure there is some mistake with the data tied to one of the orderitems, just not sure where to look.
I will post the stack trace from the log file tomorrow when I return to work.
Thanks for the help!
Errors during Basket.Checkout
Re: Errors during Basket.Checkout
Yes stack trace would be helpful you should post it. Secondly what is your application version? You can find this information under Help -> About AbleCommerce. One more thing do you have any customization in your checkout procedure ?
Re: Errors during Basket.Checkout
Here is the trace....
RROR 2009-12-10 11:16:41,625 1225406ms Object a - An error occurred during the checkout process. The checkout has failed 100 times and will NOT BE attempted again. UserId: 621 / bwilliamson@blackstonemedia.net Customer: ben williamson / bwilliamson@blackstonemedia.net /
System.InvalidOperationException: Failed to compare two elements in the array. ---> System.InvalidCastException: Specified cast is not valid.
at System.Data.SqlClient.SqlBuffer.get_Int16()
at System.Data.SqlClient.SqlDataReader.GetInt16(Int32 i)
at CommerceBuilder.Orders.OrderItem.LoadDataReader(OrderItem orderItem, IDataReader dr)
at CommerceBuilder.Orders.OrderItem.Load(Int32 orderItemId)
at CommerceBuilder.Orders.OrderItemDataSource.Load(Int32 orderItemId, Boolean useCache)
at CommerceBuilder.Orders.OrderItemComparer.GetSortPriority(OrderItem item, Boolean treatChildAsProduct)
at CommerceBuilder.Orders.OrderItemComparer.Compare(Object x, Object y)
at System.Array.SorterObjectArray.SwapIfGreaterWithItems(Int32 a, Int32 b)
--- End of inner exception stack trace ---
at System.Array.SorterObjectArray.SwapIfGreaterWithItems(Int32 a, Int32 b)
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)
at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer comparer)
at System.Collections.ArrayList.Sort(IComparer comparer)
at CommerceBuilder.Orders.a.c(Order A_0)
at CommerceBuilder.Orders.Basket.Checkout(CheckoutRequest checkoutRequest, Boolean validate, Boolean triggerEvents)
AbleCommerce Version: 7.0.2
.Net Framework Version: 2.0
RROR 2009-12-10 11:16:41,625 1225406ms Object a - An error occurred during the checkout process. The checkout has failed 100 times and will NOT BE attempted again. UserId: 621 / bwilliamson@blackstonemedia.net Customer: ben williamson / bwilliamson@blackstonemedia.net /
System.InvalidOperationException: Failed to compare two elements in the array. ---> System.InvalidCastException: Specified cast is not valid.
at System.Data.SqlClient.SqlBuffer.get_Int16()
at System.Data.SqlClient.SqlDataReader.GetInt16(Int32 i)
at CommerceBuilder.Orders.OrderItem.LoadDataReader(OrderItem orderItem, IDataReader dr)
at CommerceBuilder.Orders.OrderItem.Load(Int32 orderItemId)
at CommerceBuilder.Orders.OrderItemDataSource.Load(Int32 orderItemId, Boolean useCache)
at CommerceBuilder.Orders.OrderItemComparer.GetSortPriority(OrderItem item, Boolean treatChildAsProduct)
at CommerceBuilder.Orders.OrderItemComparer.Compare(Object x, Object y)
at System.Array.SorterObjectArray.SwapIfGreaterWithItems(Int32 a, Int32 b)
--- End of inner exception stack trace ---
at System.Array.SorterObjectArray.SwapIfGreaterWithItems(Int32 a, Int32 b)
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)
at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer comparer)
at System.Collections.ArrayList.Sort(IComparer comparer)
at CommerceBuilder.Orders.a.c(Order A_0)
at CommerceBuilder.Orders.Basket.Checkout(CheckoutRequest checkoutRequest, Boolean validate, Boolean triggerEvents)
AbleCommerce Version: 7.0.2
.Net Framework Version: 2.0
Re: Errors during Basket.Checkout
I believe I have found my issue....
Looks like someone changed the data type of the OrderBy column from a smallint to an int, allowing the values in that column to exceed 32767 that is allowed for an 16 bit signed int in .Net.
I'm just waiting now to be able to wipe this table and fix the data type.
Thanks for taking the time to respond to my post.
Looks like someone changed the data type of the OrderBy column from a smallint to an int, allowing the values in that column to exceed 32767 that is allowed for an 16 bit signed int in .Net.
I'm just waiting now to be able to wipe this table and fix the data type.
Thanks for taking the time to respond to my post.
Re: Errors during Basket.Checkout
On which table ac_CatalogNodes ? Any how of this is the case one possibility to correct it can be to execute an update command to correct the problem. For example where ever value is greater then 32767 switch it back to 32767. Something like
Code: Select all
UPDATE ac_CatalogNodes
SET OrderBy = 32767 WHERE
OrderBy > 32767
Re: Errors during Basket.Checkout
Thanks for the suggestion. The table was ac_OrderItems... A previous coder had changed the column to comply with an existing system's SeqNo column. I'm simply reseting the SeqNo when the backup occurs instead of allowing those large numbers to come through in the first place.
Thanks again!
Thanks again!