ProfileProvider question in regards to Commerce R2


In the enotaca sample site, the site uses the SqlServerProfileProvider, but it is configured with automaticSaveEnabled=true, which means that every single page view will result in a call to a stored procedure which will perform a number of selects and potientially an update to the database. This is bad for performance, so i was wondering if this setting is needed for Commerce to function properly or if i can disable it?

Nov 30, 2012 10:41

I think it could work fine if you set the automaticSaveEnabled to false. Or you can intercept this in the Global.asax:

void Profile_ProfileAutoSaving(object sender, ProfileAutoSaveEventArgs e)
{ e.ContinueWithProfileAutoSave=false;}

In ProfileModule ( EPiServer.Business.Commerce ), you could also see that it intercepts this event if the HttpContext.Items["CancelProfileAutoSave"] is true.

if ((e.Context.Items["CancelProfileAutoSave"] != null) && ((bool) e.Context.Items["CancelProfileAutoSave"]))
e.ContinueWithProfileAutoSave = false;

Dec 03, 2012 10:31
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.