logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
ray22901031  
#1 Posted : Friday, February 3, 2023 4:13:24 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 826

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
I have been involved in other issues, but the following errors occur intermitting, but on a constant basis ever since we moved to 9.0.7. It also triggers an alert in the event viewer under windows as a warning.

Is this normal?
Did we miss something during the upgrade?

Thanks,
-Ray



Could not recalculate with the configured tax provider: CommerceBuilder.Services.Taxes.AbleCommerce.AbleCommerceTax, CommerceBuilder View less
Exception: deleted object would be re-saved by cascade (remove deleted object from associations)[CommerceBuilder.Orders.OrderItem#7501] Stack Trace: at NHibernate.Impl.SessionImpl.ForceFlush(EntityEntry entityEntry) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event) at CommerceBuilder.DomainModel.SaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.SaveOrUpdate(String entityName, Object obj) at NHibernate.Engine.Cascade.CascadeToOne(Object parent, Object child, IType type, CascadeStyle style, Object anything, Boolean isCascadeDeleteEnabled) at NHibernate.Engine.Cascade.CascadeCollectionElements(Object parent, Object child, CollectionType collectionType, CascadeStyle style, IType elemType, Object anything, Boolean isCascadeDeleteEnabled) at NHibernate.Engine.Cascade.CascadeCollection(Object parent, Object child, CascadeStyle style, Object anything, CollectionType type) at NHibernate.Engine.Cascade.CascadeAssociation(Object parent, Object child, IType type, CascadeStyle style, Object anything, Boolean isCascadeDeleteEnabled) at NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object parent, Object anything) at NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(IEventSource session, IEntityPersister persister, Object key, Object anything) at NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(IEventSource session) at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event) at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) at NHibernate.Impl.SessionImpl.Flush() at CommerceBuilder.DomainModel.RepositoryWithTypedId`2.Save(TEntity item) at CommerceBuilder.DomainModel.Repository`1.Save(TEntity item) at CommerceBuilder.Orders.OrderRepository.Save(Order item, Boolean triggerPaymentEvents) at CommerceBuilder.Services.Taxes.AbleCommerce.AbleCommerceTax.Recalculate(Order order) at CommerceBuilder.Taxes.TaxCalculator.Recalculate(Order order)

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

nadeem  
#2 Posted : Monday, February 6, 2023 7:49:22 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 times
Was thanked: 18 time(s) in 18 post(s)
Hi Ray,

Have you added some custom code for the Recalculate function in admin. Specifically, may be there is some custom code related to the Discounts recalculation causing this?
ray22901031  
#3 Posted : Monday, February 6, 2023 8:35:43 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 826

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Absolutely no custom coding regarding discounts or anything else relating this. It usually does not affect the end user, but I don't like seeing this error in the windows log. And we seem to be getting more and more of them. Please let me know what else I can provide to you, or at the very least, a course of action for my developer to follow.

Thanks
nadeem  
#4 Posted : Monday, February 6, 2023 11:42:02 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 times
Was thanked: 18 time(s) in 18 post(s)
Ok, I am able to reproduce the issue. This is happening when you Recalculate shipping and taxes together from merchant admin. That is, when you click Recalculate button, it opens a popup with two checkbox selections:

  • Recalculate shipping charges
  • Recalculate taxes

As a workaround, you can Recalculate these items individually. That being said, you can first Recalculate shipping (uncheck Recalculate taxes) and then Recalculate taxes (uncheck Recalculate shipping charges).
ray22901031  
#5 Posted : Monday, February 6, 2023 1:14:25 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 826

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Absolutely thrilled that you're able to reproduce the problem. I have instructed my people to update one item at a time in situations like this. Again, I don't see this affecting the web user, but I like having my error logs clean both inside of AbleCommerce and outside.

Thank you so much,
-Ray
nadeem  
#6 Posted : Tuesday, February 7, 2023 11:02:55 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 times
Was thanked: 18 time(s) in 18 post(s)
You can make the following code changes to fix the issue:

Open /Website/Areas/Admin/Controllers/OrdersController.cs file and find the RecalculateShipment post method

Locate the following line of code around line# 4825

Code:
// update shipment items
  shipment.OrderItems.Add(shipRateLineItem);
}


and replace with

Code:
// update shipment items
  shipment.OrderItems.Add(shipRateLineItem);
}

// SAVE ORDER
order.Save(true, false);


Similarly, locate the following code:

Code:
// RECALCULATE TAXES FOR THE ORDER
if (recalculateTaxes)
{
    TaxCalculator.Recalculate(order);
}

// SAVE ORDER
order.Save(true, false);


and replace with

Code:
AbleContext.Current.Database.GetSession().Refresh(order);

// RECALCULATE TAXES FOR THE ORDER
if (recalculateTaxes)
{
   TaxCalculator.Recalculate(order);
}


Now compile the website code and deploy the updated AbleCommerce.dll
ray22901031  
#7 Posted : Tuesday, February 7, 2023 11:09:37 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 826

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
You are the BEST!!!
thanks 1 user thanked ray22901031 for this useful post.
nadeem on 2/7/2023(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.