Intermittent DAAB Configuration Error -- "The requested database is not defined in configuration".

Topics: Data Access Application Block
Aug 20, 2009 at 4:28 PM

We are running BizTalk 2006 R2 Enterprise Server on Windows 2003 SP2 OS.  In a particular BizTalk application, we have a pipeline component that calls a helper class.  The helper class utilizes the Data Access Application Block from Enterprise Library 3.1 to connect to SQL Server and call a stored procedure.  Since we are dealing with a SOAP transport type that runs in an Isolated host, we have the connectionStrings configured in the associated web.config file.  The connectionStrings setting from the web.config file is shown below:  

            <connectionStrings>
                        <add name="XXXXXXXXXX" connectionString="Database=YYYYYYY;Server=ZZZZZZZ;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
            </connectionStrings>

For several weeks there were no issues with this set up.  However, we started to intermittently receive the configuration exception shown below.  There seems to be no pattern to when this exception occurs.  Once the exception started, it began to occur more frequently (i.e. after first occurrence, second occurrence was a few weeks later, then next occurrence was a week later, then a few occurrences in one week etc.)     

System.Configuration.ConfigurationErrorsException: The requested database XXXXXXXXXX is not defined in configuration.
  at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.ValidateConnectionStringSettings(String name, ConnectionStringSettings connectionStringSettings)
  at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetConnectionStringSettings(String name)
  at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)
  at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)
  at Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)
  at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)
  at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)
  at Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)
  at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)
  at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp[TTypeToBuild](IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, String id, IConfigurationSource configurationSource)

The only way we have found to get by this exception is to do an IIS reset.  After the reset, the application is kicked off again and the pipeline component calls the helper class which connects successfully to the database.

 Any insights would be appreciated!

 

Aug 24, 2009 at 6:46 AM

Hi,

Do you use ESB toolkit in your app? I found this link: http://gloriousmonster.blogspot.com/2009/06/esb-toolkit-20-has-surprise-for.html . It could be one cause.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Aug 24, 2009 at 1:58 PM

We are not using the ESB toolkit in our app.

Thanks

 

Aug 25, 2009 at 1:08 AM

Will this article help? - http://www.codeproject.com/KB/biztalk/BizTalk_and_Ent_Lib_3.1.aspx.  I haven't used BizTalk so I don't know how it exactly works.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com