Question about NHibernate

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
rmaweb
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Fri Sep 10, 2010 9:41 am

Question about NHibernate

Post by rmaweb » Tue Jun 10, 2014 6:29 am

Hello Everyone,

I am working on merging my codebase with the new able gold R8 update. I am not familiar with NHibernate so when it is being used in the category conlib pages, is it doing anything for those pages? Or is it "preloading" the data into a cache for when someone clicks to a product page from that category page? Because I see it "fetching" various stuff like "productOptions", "productKitComponents", "productTemplates", etc which aren't used on the category pages.

Thanks,
Ryan
Ryan A.
Scott's Bait and Tackle
http://store.scottsbt.com
Work In Progress
Able Gold R10
Bootstrap 3.3

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Question about NHibernate

Post by Katie » Tue Jun 10, 2014 8:07 am

Hi Ryan,

I've asked a developer to look into this for you. In the change log, there is a feature "Use Eager Fetch on retail side when loading products", but you make a valid point about why we are preloading product options, kit components, etc. We should have an answer by tomorrow morning.

Thanks for your patience.
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

rmaweb
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Fri Sep 10, 2010 9:41 am

Re: Question about NHibernate

Post by rmaweb » Tue Jun 10, 2014 10:55 am

Thank you Katie for the quick response. Look forward to their answer.

Thanks,
Ryan
Ryan A.
Scott's Bait and Tackle
http://store.scottsbt.com
Work In Progress
Able Gold R10
Bootstrap 3.3

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Question about NHibernate

Post by Naveed » Wed Jun 11, 2014 3:20 am

Ryan is right about fetching related product data from database for all category pages. The data is pre-fetched/loaded from database and cached by nhibernate before rendering products information at category pages, this data is later used by different controls (e.g. ~/ConLib/ProductPrice.ascx, ~/ConLib/ProductItemDisplay.ascx etc.). We do this for performance boost, so that instead querying database for one product at a time we load all related data in one go. This saves multiple database access round trips.

rmaweb
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Fri Sep 10, 2010 9:41 am

Re: Question about NHibernate

Post by rmaweb » Wed Jun 11, 2014 4:46 am

Thank you for your answer Naveed. That is a pretty neat feature. But now I have another question, lol. The data that is NHibernate is accessing/caching, is that for use only by that user that is browsing that category? Or is the cache used by other browsing people too? And is the cache timeout a relatively short one that won't interfere with daily product updates?

Thank you for your time,
Ryan
Ryan A.
Scott's Bait and Tackle
http://store.scottsbt.com
Work In Progress
Able Gold R10
Bootstrap 3.3

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Question about NHibernate

Post by Naveed » Wed Jun 11, 2014 7:38 am

The data is cached/fetched only for current nhibernate session. We usually use one session per http request, so you can safely assume it is cached for only one browser request. Next time the page is loaded, it will use a new nhibernate session and will again access the database.

Post Reply