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

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Possible problem in the Dotnetnuke core lib on ver 5.xPossible problem in the Dotnetnuke core lib on ver 5.x
Previous
 
Next
New Post
10/24/2009 10:57 AM
 

I have been trying to upgrade my 4.9.4 site to 5.1.4 for about a week without success so in order to get to the bottom of the problem I downloaded the source for the new 5.1.4 and replaced the website in the solution with mine(after copying the 5.1.4  install package over it) and changed all the compiler setting to produce debug output and target my sites bin directory. Here is what I found: during upgrade a stack overflow exception was being thrown from the install.aspx.vb file at the line "Services.Upgrade.Upgrade.UpgradeDNN(strProviderPath, DataProvider.Instance().GetVersion)" after stepping through in the debugger I found that the DataProvider.Instance() was returning the wrong provider instance so the GetVersion failed this triggered exception handling code which attempts to log the exception to the database and those calls access the wrong DataProvider and generated further exceptions in a never ending loop thus the stack overflow. Now the problem is stemed from the fact that my webconfig file in not the same as the vanilla install. I have developed some of my own modules and two of them access data from other databases so after reading Shaun Walkers "DotNetNuke Data Access" paper I concluded that I could add my databases to the appropreate section in the webconfig like this:

<connectionStrings>
    <add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|Database.mdf;" providerName="System.Data.SqlClient" />
    <add name="GriffinSqlServer" connectionString="Data Source=HAL9000\GRIFFINSQL;Database=GriffinContacts;uid=INTERNAL\jfeyes;pwd=xxxxxxx;" providerName="System.Data.SqlClient" />
    <add name="ProjectSqlServer" connectionString="Data Source=CRAYII;Database=ProjectServer_Reporting;uid=DNN;pwd=xxxxxxx;" providerName="System.Data.SqlClient" />
 </connectionStrings>

......

<data defaultProvider="SqlDataProvider">
      <providers>
        <clear />
        <add name="SqlDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionStringName="SiteSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="" databaseOwner="dbo" />
        <add name="GriffinDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionStringName="GriffinSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="" databaseOwner="dbo" />
        <add name="ProjectDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionStringName="ProjectSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="" databaseOwner="dbo" />
      </providers>
    </data>

And it worked fine from the time I wrote the modules back in version 4.0 all the way through to version 4.9.4 and I never once encountered a problem upgrading. But now for some reason the core seems to not be picking up the defaultProvider and grabbing the second entry from the data/providers section. So is there something not right in the core?

Anyway to remidy the problem I created new provider types in the webconfig like this:

<configuration>
  <!-- register local configuration handlers -->
  <configSections>
    <sectionGroup name="dotnetnuke">
      <!-- the requirePermission attribute will cause a syntax warning - please ignore - it is required for Medium Trust support-->
      <section name="data" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
      <section name="projectdata" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
     <section name="contactdata" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />

Then made seperate provider entries for those types like this:

<data defaultProvider="SqlDataProvider">
      <providers>
        <clear />
        <add name="SqlDataProvider"
      type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider"
      connectionStringName="SiteSqlServer"
      upgradeConnectionString=""
      providerPath="~\Providers\DataProviders\SqlDataProvider\"
      objectQualifier=""
      databaseOwner="dbo" />
      </providers>
    </data>
    <projectdata defaultProvider="ProjectDataProvider">
      <providers>
        <clear />
        <add name="ProjectDataProvider"
             type="GriffinAutomation.Modules.Griffin_Projects.SqlDataProvider, GriffinAutomation.Modules.Griffin_Projects"
             connectionStringName="ProjectSqlServer"
             upgradeConnectionString=""
             providerPath=""
             objectQualifier=""
             databaseOwner="dbo"/>
      </providers>
    </projectdata>
    <contactdata defaultProvider="GriffinDataProvider">
      <providers>
        <clear />
        <add name="GriffinDataProvider"
             type="GriffinAutomation.Modules.Griffin_BCM.SqlDataProvider, GriffinAutomation.Modules.Griffin_BCM"
             connectionStringName="GriffinSqlServer"
             upgradeConnectionString=""
             providerPath=""
             objectQualifier=""
             databaseOwner="dbo"/>
      </providers>
    </contactdata>

Now in the data access layer code for the module one change is needed to reference the new type instead of "data" like this:

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Framework.Providers


Namespace GriffinAutomation.Modules.Griffin_Projects

    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' SQL Server implementation of the abstract DataProvider class
    ''' </summary>
    ''' <remarks>
    ''' </remarks>
    ''' <history>
    ''' </history>
    ''' -----------------------------------------------------------------------------
    Public Class SqlDataProvider
        Inherits DataProvider

        Private Const ProviderType As String = "projectdata"
        Private Const ModuleQualifier As String = ""
        Private _providerConfiguration As ProviderConfiguration = ProviderConfiguration.GetProviderConfiguration(ProviderType)
        Private _connectionString As String
        Private _providerPath As String
        Private _objectQualifier As String
        Private _databaseOwner As String

After these changes everything seems ok. But the question remains, Why did 5.1.4 break with my webconfig setup? somthings not right.

 
New Post
2/25/2010 1:44 PM
 

+1

Thank you for the workaround Jack.

 

 
New Post
2/25/2010 3:00 PM
 
please log your findings into the issue tracker at support.dotnetnuke.com. Thank you!

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Possible problem in the Dotnetnuke core lib on ver 5.xPossible problem in the Dotnetnuke core lib on ver 5.x


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