Hello everyone,
Recently, I faced the problem in using Nhibernate with .NET application
The followings are the message that captured from the logging:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'hibernate.show_sql' Key being added: 'hibernate.show_sql' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.Add(Object key, Object value) at System.Collections.Hashtable..ctor(IDictionary d, Single loadFactor, IEqualityComparer equalityComparer) at NHibernate.Cfg.Configuration.Reset() at NHibernate.Cfg.Configuration..ctor() The following is the webconfig.xml in my asp.net applcation for my webservice <?xml version="1.0"?> <configuration> <configSections> <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </configSections> <appSettings> <!--add key="ProviderType" value="OLEDB"/> <add key="OleDbConnectionString" value="Provider=SQLOLEDB.1;Data Source=192.168.130.50;User ID=sa;Password=sa;Initial Catalog=sa"/--> <add key="ReportingServer" value="http://192.168.130.50/ReportServer"/> <add key="ReportingPath" value="/Report"/> </appSettings> <nhibernate> <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/> <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect"/> <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/> <add key="hibernate.connection.connection_string" value="Data Source=192.168.130.50;User ID=sa;Password=sa;Initial Catalog=sa;Min Pool Size=2"/> <add key="hibernate.show_sql" value="true"/> <add key="hibernate.use_outer_join" value="true"/> <add key="hibernate.query.substitutions" value="true 1, false 0, yes 'Y', no 'N'"/> </nhibernate> <system.web>
<httpHandlers> <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" /> </httpHandlers> <compilation debug="true"> <buildProviders> <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </buildProviders> </compilation>
<authentication mode="Windows"/>
<customErrors mode="Off"/> <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8"/> <trust level="Full" />
</system.web> </configuration>
Actually, it is a application that include ASP.NET, windows mobile 6.1 application and used web service for database connection with Nhibernate The ASP.NET web page is used to create user, data maintainence and reporting
The web service contain 2 web methods: 1. User ID and password checking 2. database sync from database to (or to database from) windows mobile(eg. for stock control).
The error occurs when someone try to login to windows mobile application by using 1st web method. This problem is not always happened. It happened 2 times and I need to "solve" the problem in following ways: 1st: The application turned to be normal after 10-15 mins with no action taken by me 2nd: I need to manually reboot the windows server 2003.
Can anyone tell me why the problem exist? And, this problem can have solution?
Thank you for giving me advices.
|