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
Compunerdy  
#1 Posted : Tuesday, November 23, 2021 3:59:05 PM(UTC)
Compunerdy

Rank: Newbie

Groups: Authorized User
Joined: 12/4/2018(UTC)
Posts: 5

I understand that CustomFields are to be used for more simple applications, but as a Source holder, I figured the process should be ironed out for users to add their own fields to the database if they see fit.

This post will contain only excerpts and source I have written.

I have created the following custom class, located in a custom version of the CommerceBuilder assembly for use throughout our store.


To include this field in the database, I have added the following mapping to the product.hbm.xml file.


And the following field to the definition of the Product object, in Product.cs


The following SQL is used to generate these fields in a (live) database, after a normal, functional upgrade from AC Gold.


Assuming the above is dotting all Is and crossing all Ts, we end up hitting a roadblock. Requests to the Admin and Product listing pages end up timing out, and despite request tracing and logging wizardry of the highest degree, I am unable to narrow down the cause of the page timeout. fr000002.zip (15kb) downloaded 3 time(s). is a Failed Request Log generated as demonstrated here.

The Failed Request Log shows the last AspNetPipelineEnter event before erroring out is event 413. regarding CommerceBuilder.Licensing.AbleApplication+a, of which even Source holders have no access to. I would like some assistance as to whether I am barking up the wrong tree here. I have added objects to the database in the past, but component mapping specifically seems to cause issues on our development site.

Thank you for your time.

Edited by user Tuesday, November 23, 2021 4:07:00 PM(UTC)  | Reason: Clarification of FRL location. They are large files.

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

nadeem  
#2 Posted : Monday, November 29, 2021 11:33:10 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)
Are you able to figure this out? I tried your code and it is working good for me.

I have to make some changes though:

Added a below property to Product.cs file

Code:

/// <summary>
/// Gets or sets the ProductLocation
/// </summary>
public virtual ProductLocation ProductLocation { get; set; }


Also, updated your code to make use of the above line of code. That is;

Code:

/// <summary>
/// Gets or sets the physical Location of this product
/// </summary>
public virtual ProductLocation Location
{
    get
    {
       if (this.ProductLocation == null)
       {
           this.ProductLocation = new ProductLocation();
       }
       return (ProductLocation)this.ProductLocation;
    }
    set
    {
       this.ProductLocation = value;
    }
}


Let me know how you are using this so that I have better idea of your issue. Thanks!

Edited by user Monday, November 29, 2021 11:38:56 AM(UTC)  | Reason: Not specified

Compunerdy  
#3 Posted : Monday, November 29, 2021 12:04:43 PM(UTC)
Compunerdy

Rank: Newbie

Groups: Authorized User
Joined: 12/4/2018(UTC)
Posts: 5

Hello nadeem, I appreciate your answer.

I will try using a backing property as you have described.
As for the usage, it's essentially a semi-complex object to help with our physical handling of goods. We have nearly 2,000 products spread across multiple shelves in our warehouse. When pulling an order, it helps to organize the OrderItems in such a way that an employee can follow a pre-determined path through the warehouse, and grab all of the physical items in order. It also helps cut down on the mistakes that can be made by grabbing similarly SKUd products that are in different physical locations, as they will appear out of order.

Use of a backing property is not an issue, I was just having trouble getting these fields to properly work in the database. Do you think my custom getter and setter methods are causing issues with nhibernate? I am interested in finding the root cause, in case I want to make a change like this in the future. Ideally I'd avoid a backing property but it's not strictly necessary.

EDIT: It absolutely is the null-check within the getter that is causing this issue. When working with nhibernate, it is not able to process this recursive reference in this way, and requires the use of a backing field to prevent IIS from timing out (silently, I might add) and making hard to trace errors.

In the future, I will use backing fields, or the pre-built AbleCommerce null-safe database objects.

Thank you for the help!

Edited by user Monday, November 29, 2021 12:40:25 PM(UTC)  | Reason: Not specified

nadeem  
#4 Posted : Tuesday, November 30, 2021 3:57:46 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 nailed it! Yes, that was the cause of the failure.
Users browsing this topic
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.