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
sweeperqb  
#1 Posted : Friday, June 17, 2022 3:58:50 PM(UTC)
sweeperqb

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 5/30/2020(UTC)
Posts: 125

Thanks: 14 times
Was thanked: 3 time(s) in 3 post(s)
When using RegisterFor from a plugin we have a list of Lifestyle scopes we can provide, such as Transient, Singleton, PerThread, and PerWebRequest.

I had to move some things to a custom folder in the web project. RegisterFor does not automatically work in the AbleCommerce web project, so we instead have to use the /App_Data/windsor.config file.

  1. What lifestyle are items registered for if not specified with a lifestyle attribute?
  2. What value do we use for PerWebRequest lifestyle? Looking at the 4.0.0 documentation it doesn't have a value to specify for PerWebRequest.
  3. The documentation says that in order for PerWebRequest lifestyle to work that the PerWebRequestLifestyleModule must be set up in web.config (it is not in AC9, but AC9 doesn't appear to have anything set up as PerWebRequest by default either). Before I add this to my web.config I want to make sure it isn't being configured somewhere else.

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

sweeperqb  
#2 Posted : Friday, June 17, 2022 4:12:04 PM(UTC)
sweeperqb

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 5/30/2020(UTC)
Posts: 125

Thanks: 14 times
Was thanked: 3 time(s) in 3 post(s)
I set a breakpoint in Global.asax and put the container in the debug watch list. It appears that if a lifestyle is not specified that it defaults to Singleton. All of the AbleCommerce controllers get registered as Transient, but all of the classes in CommerceBuilder that have a RegisterFor without a lifestyle end up as Singletons. I'm not sure if that was the intent of the developers?!?
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.