Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Multiple calls to GetPortalDictionaryMultiple calls to GetPortalDictionary
Previous
 
Next
New Post
3/2/2010 5:10 AM
 

 We are running a vary large DNN installation with over 300 child portals. We are running with DNN v4.9.4.

We have experienced a few problems recently with the amount of data that certain core DNN functions require from the database.

The worse offender at the moment is the GetAllTabs function. I found one fix in the DNN Gemini that has made a huge difference - : http://support.dotnetnuke.com/issue/ViewIssue.aspx

However we are all seeing this procedure being called from the GetPortalDictionary in the PortalController. What I am struggling to understand though are the repeated calls to the SP.

The function tries to get the PortalDictionary from the Cache. If it cannot find it, the PortalDictionary is recreated by calling the GetAllTabs SP and once complete, it stores it in cache. I recently amended the function to write to the event log every time it calls the GetAllTabs function.

What I am seeing is repeated calls to the GetAllTabs.  

My question is why would this happen?

Why is the code not finding the PortalDictionary in Cache (shown in blue below)?

Here is the code I am referring to:

 

        Public Shared Function GetPortalDictionary() As Dictionary(Of Integer, Integer)

             Dim key As String = DataCache.PortalDictionaryCacheKey

            ' retrieve from cache
            Dim portalDic As Dictionary(Of Integer, Integer) = TryCast(DataCache.GetCache(key), Dictionary(Of Integer, Integer))

            If portalDic Is Nothing Then
                ' create dictionary
                portalDic = New Dictionary(Of Integer, Integer)

                ' portal dictionary caching settings
                Dim timeOut As Int32 = DataCache.PortalDictionaryTimeOut * Convert.ToInt32(Common.Globals.PerformanceSetting)
 
                ' if caching is disabled, do not make this database call as it is too expensive on every request
                If timeOut > 0 Then
                    ' get all tabs
                    'My code to write to event Log                     Dim PS As Entities.Portals.PortalSettings                     PS = GetHostPortalSettings()                     Dim ctlrEventLog As New DotNetNuke.Services.Log.EventLog.EventLogController                     ctlrEventLog.AddLog("Calling GetAllTabs ", "", PS, -1, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT)

                    Dim intField As Integer
                    Dim dr As IDataReader = DataProvider.Instance().GetAllTabs()
                    Try
                        While dr.Read
                            ' add to dictionary
                            portalDic(Convert.ToInt32(Null.SetNull(dr("TabID"), intField))) = Convert.ToInt32(Null.SetNull(dr("PortalID"), intField))
                        End While
                    Catch exc As Exception
                        LogException(exc)
                    Finally
                        ' close datareader
                        If Not dr Is Nothing Then
                            dr.Close()
                        End If
                    End Try
                    ' cache portal dictionary
                    DataCache.SetCache(key, portalDic, TimeSpan.FromMinutes(timeOut), True)
                End If
            End If

             Return portalDic
        End Function

 

 

 

 

 


Blue & White hooped blood runs through my veins!
 
New Post
9/27/2011 10:53 AM
 
** POP **

Restarting this thread as I have started seeing multiple occurances of this SP being run in my DNN environment.
I am running DNN V4.9.4

As stated in the original thread, I am working in a large environment with about 400+ child portals and I made so that whenever a call is made to this SP an alert is written to the event log.
I have a sinlge file server and four web servers

I am also experiencing App_Pool failures which appear to coincide with the multiple occurances of this SP being run.

Upgrading to a later version of DNN is not an option at present - too many reasons to go into here.

Any suggestions or help would be greatly appreciated.
 
New Post
9/27/2011 10:59 AM
 
Just as an addendum, I noticed the link in my original email doesn't work, so here is a new one: http://support.dotnetnuke.com/issue/V...

R.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Multiple calls to GetPortalDictionaryMultiple calls to GetPortalDictionary


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out