Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Christian Rieß 24 posts 46 karma points
    Apr 25, 2012 @ 13:27
    Christian Rieß
    0

    NHibernate Error when saving basket

    Hi,

    I encountered following Error from the umbraco Log:

        At /set-konfigurator/ (Referred by: http://testweb.net/set-konfigurator/): 
        NHibernate.PropertyValueException: not-null property references a null or transient value UCommerce.EntitiesV2.OrderProperty.Value
        bei NHibernate.Engine.Nullability.CheckNullability(Object[] values, IEntityPersister persister, Boolean isUpdate)
        bei NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
        bei NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
        bei NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
        bei NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
        bei NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
        bei NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
        bei NHibernate.Impl.SessionImpl.SaveOrUpdate(String entityName, Object obj)
        bei NHibernate.Engine.Cascade.CascadeCollectionElements(Object child, CollectionType collectionType, CascadeStyle style, IType elemType, Object anything, Boolean isCascadeDeleteEnabled)
        bei NHibernate.Engine.Cascade.CascadeCollection(Object child, CascadeStyle style, Object anything, CollectionType type)
        bei NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object parent, Object anything)
        bei NHibernate.Event.Default.AbstractSaveEventListener.CascadeAfterSave(IEventSource source, IEntityPersister persister, Object entity, Object anything)
        bei NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
        bei NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
        bei NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
        bei NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
        bei NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
        bei NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event) bei NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
        bei UCommerce.EntitiesV2.Repository`1.Save(T entity) bei ScoutRetail.Controls.SetConfigurator.btnBuy_OnClick(Object sender, EventArgs e)
        in Y:\Workspace\Projekte\...\SetConfigurator.ascx.cs:Zeile 1759.
        bei System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
        bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    The codeline which triggers the Error is "basket.Save();" where basket is defined with "var basket = SiteContext.Current.OrderContext.GetBasket().PurchaseOrder;"

    The whole function looks like this:

            protected void btnBuy_OnClick(object sender, EventArgs e)
            {

                ProductCatalog catalog =
                    ProductCatalog.All().SingleOrDefault(x => x.Name == CatalogName);
                SiteContext.Current.CatalogContext.CurrentCatalogName = catalog.Name;

                var basket = SiteContext.Current.OrderContext.GetBasket().PurchaseOrder;

                Product setProduct = Product.All().Single(x => x.Sku == ContainerSetProductSku && x.ParentProduct == null);

                OrderLine setOrderLine = basket.AddProduct(catalog, setProduct, 1, false);
                setOrderLine["setSku1"] = (string)Session[this.UniqueID + "baseProduct"];
                setOrderLine["setSku2"] = (string)Session[this.UniqueID + "accSku1"];
                if(divAccessory2Vis.Visible) {
                    setOrderLine["setSku3"] = (string)Session[this.UniqueID + "accSku2"];
                }
                if (divAccessory3Vis.Visible) {
                    setOrderLine["setSku4"] = (string)Session[this.UniqueID + "accSku3"];               
                }
                if(divAccessory4Vis.Visible) {
                    setOrderLine["setSku5"] = (string)Session[this.UniqueID + "accSku4"];
                }
                if(divAccessory5Vis.Visible) {
                    setOrderLine["setSku6"] = (string)Session[this.UniqueID + "accSku5"];
                }
                setOrderLine["catalogName"] = CatalogName;
                setOrderLine.VariantSku = (string)Session[this.UniqueID + "variantSku"];
                setOrderLine.ProductName = setProduct.Name + " " + (string)Session[this.UniqueID + "baseProductName"] + " " + (string)Session[this.UniqueID + "variantSkuName"];

                setOrderLine.Save();

                basket.Save(); //This is line 1759, where the Error occurs

                Library.ExecuteBasketPipeline();

                lnkCartMessage.Visible = true;

                Response.Redirect(new Node(CartPageID).NiceUrl);

            }

     

    As you can see, I use dynamic orderline properties. Maybe there is a problem with one of them? Any other ideas?

  • Floris Robbemont 57 posts 89 karma points c-trib
    Apr 25, 2012 @ 14:16
    Floris Robbemont
    1

    Try removing that line :basket,Save();

    The Basket pipeline will save the purchase order at the end of it's task set, so there's no need to save it before that. That could also be part of the problem, the pipeline also takes care of some of the validation.

    I don't know if this is the case, but applying 'null' to an order property might also cause this error. If you replace the part where you get the value from the session with this:

    (string)Session[this.UniqueID+"baseProduct"] ?? String.Emtpy

    This will insert an empty string when the value from the session returns null. That might fix your problem too.

    Cheers,

    Floris

  • Christian Rieß 24 posts 46 karma points
    Apr 25, 2012 @ 14:31
    Christian Rieß
    0

    Thank you very much, I will try that.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 30, 2012 @ 08:37
    Søren Spelling Lund
    0

    Hi Christian,

    Did you get it sorted?

  • Christian Rieß 24 posts 46 karma points
    Apr 30, 2012 @ 09:19
    Christian Rieß
    0

    Hi Søren, unfortunately the error occured only once until now and could not be reproduced. I think I can't properly test until the website goes life.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 30, 2012 @ 15:45
    Søren Spelling Lund
    0

    Be sure to shoot me an e-mail directly if you see this behavior again so we can get it fixed quickly.

  • Saeed Bidarang 3 posts 23 karma points
    Oct 18, 2012 @ 15:01
    Saeed Bidarang
    0

    I got almost same error:

    We have too many complain which customers have done payment but they get error page, so I tried it on our staging webste and faced following error:

     

    Server Error in '/' Application.


    not-null property references a null or transient value UCommerce.EntitiesV2.OrderProperty.Value

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: NHibernate.PropertyValueException: not-null property references a null or transient value UCommerce.EntitiesV2.OrderProperty.Value

    Source Error: 

    Line 97:             Utilities.SendEmail("[] Error", message, "")
    Line 98:             'RedirectFailure()
    
    Line 99: Throw ex
    Line 100:        End Try
    Line 101:


    Source File: C:\inetpub\---\masterpages\6-OrderConfirmation.master.vb    Line: 99 

    Stack Trace: 

    [PropertyValueException: not-null property references a null or transient value UCommerce.EntitiesV2.OrderProperty.Value]
       NHibernate.Engine.Nullability.CheckNullability(Object[] values, IEntityPersister persister, Boolean isUpdate) +497
       NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess) +723
       NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess) +261
       NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event) +49
       NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event) +113
       NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event) +365
       NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event) +394
       NHibernate.Impl.SessionImpl.SaveOrUpdate(String entityName, Object obj) +392
       NHibernate.Engine.Cascade.CascadeCollectionElements(Object child, CollectionType collectionType, CascadeStyle style, IType elemType, Object anything, Boolean isCascadeDeleteEnabled) +546
       NHibernate.Engine.Cascade.CascadeCollection(Object child, CascadeStyle style, Object anything, CollectionType type) +262
       NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object parent, Object anything) +578
       NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(IEventSource session, IEntityPersister persister, Object key, Object anything) +157
       NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(IEventSource session) +364
       NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event) +225
       NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) +161
       NHibernate.Impl.SessionImpl.Flush() +509
       UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.CreateUmbracoMemberForOrder(PurchaseOrder purchaseOrder) +334
       UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.Execute(PurchaseOrder purchaseOrder) +55
       UCommerce.Pipelines.Pipeline`1.Execute(T subject) +275
    
    [PipelineException: Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'. See inner exception for details.]
       masterpages_6_OrderConfirmation.Page_Load(Object sender, EventArgs e) in C:\inetpub\\masterpages\6-OrderConfirmation.master.vb:99
       System.Web.UI.Control.LoadRecursive() +71
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
    
  • Floris Robbemont 57 posts 89 karma points c-trib
    Oct 18, 2012 @ 16:46
    Floris Robbemont
    1

    Do you have the entire marco script code? It's probably the same problem as above where null (Nothing in VB) is applied to the value of an orderproperty.

    In VB:

    purchaseOrder("nameOfTheProperty").Value = newValue

    Where the outcome of newValue returns nothing. When that property is saved it throws an exception. Could you check if this is the case?

Please Sign in or register to post replies

Write your reply to:

Draft