DAAB: The requested database MyDB is not defined in configuration

Topics: Data Access Application Block
Jan 21, 2010 at 11:46 AM

Hi guys.

I'm using EntLib 3.1 for almost three years now and I have started to have a very frustrating error which happens to only one of my users and only recently.

The strange thing about it is that it happens in the middle of application. Application connects to MyDB from the very start and all my classes use DatabaseFactory.CreateDatabase(string) overload. After this exceptions surfaces, the user is unable to continue working and closes the application. Opening application again doesn't result in further errors.

Do you have any theories on how is this possible and how would you approach in researching this error? Thanks in advance.

 

 

 

 

 

 

 

 

Jan 21, 2010 at 12:52 PM

Can you post the exception that was encountered so we can further investigate the issue?

/Benjie

Jan 21, 2010 at 1:13 PM

Sure. I use EntLib logging for all my logging purposes. Also, I have found out that this happens usually after a longer period of inactivity (an hour or two). The application is running but user is working somewhere else, when he decides to come back it crashes.

Logged exception:

Timestamp: 21.1.2010 12:25:00
Message: HandlingInstanceID: 6611464b-3c78-4ec4-ac62-abd955ba0eec
An exception of type 'System.Configuration.ConfigurationErrorsException' occurred and was caught.
-------------------------------------------------------------------------------------------------
01/21/2010 13:25:00
Type : System.Configuration.ConfigurationErrorsException, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Message : The requested database LAUSCC-Argosy4LausCC is not defined in configuration.
Source : Microsoft.Practices.EnterpriseLibrary.Data
Help link : 
BareMessage : The requested database LAUSCC-Argosy4LausCC is not defined in configuration.
Filename : 
Line : 0
Errors : System.Configuration.ConfigurationException[]
Data : System.Collections.ListDictionaryInternal
TargetSite : Void ValidateConnectionStringSettings(System.String, System.Configuration.ConnectionStringSettings)
Stack Trace : 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.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)
  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)
  at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](String id, IConfigurationSource configurationSource)
  at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.Create(String name)
  at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(String name)
  at Base.TipObjekta.DalTipObjekta..ctor(String TipObjektaTipObjekta) in c:\Argosy32\Argosy\Argosy32Bit\Sources\Argosy\Base\Sifarnici\TipObjekta.cs:line 167

Additional Info:

MachineName : SRV-ODIN
TimeStamp : 21.1.2010 12:25:00
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null
AppDomainName : Argosy.exe
ThreadIdentity : 
WindowsIdentity : DU\car

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: SRV-ODIN
Application Domain: Argosy.exe
Process Id: 8240
Process Name: E:\Program Files (x86)\Argosy4Laus\Argosy32Bit_20100119.4\x86\Release\Argosy.exe
Win32 Thread Id: 10756
Thread Name: 
Extended Properties: 


Jan 22, 2010 at 4:43 AM

Hi,

Do you have a connection string named "LAUSCC-Argosy4LausCC" in your config file? 

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

Jan 22, 2010 at 7:55 AM

It's there. User works with that connection string 5 days per week and about 3-4 hours per day. This error never happened at startup of application. Application does have an option to change databases but that option is reserved for administrator user which this user is not. Configuration file has about 20 connections strings, 2 custom provider mappings, exception handling block, logging block, app settings and a system.net block for e-mail settings.

So far, I have modified my custom exception handler to catch ConfigurationErrorsException and enumerate all ConfigurationManager.ConnectionStrings into EventLog. Now I'm waiting for error to happen again.

Also, the application is located on Win2003 TS server which is quite a busy place. User connects via remote desktop to the server and application.

 

Jan 25, 2010 at 3:29 AM

If you have managed to repro the exception and enumerate the connection strings, let us know.

 

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

Feb 2, 2010 at 8:08 AM

It appears that this error stopped happening all by itself. I'll raise this thread again if this problem resurfaces. Thanks.