Re: Null-Reference Exception at loading CuteChat time

  •  02-20-2007, 9:03 AM

    Re: Null-Reference Exception at loading CuteChat time

     
    Hi Adam
     
    Yes, you are right, the same problem does not occur in the standalone version and it has to do with the way we integrated cuteChat. I did some more investigations and this is what i have found out:
     
    Due to our special environment with two VS 2005 solutions, we could not use the global.asax file to implement the needed interfaces  that connect CuteChat to our user database. We implemented those methods in a separate project/dll and referenced them in the CuteChat database. The following two insert statements do this:
     
    INSERT CuteChatConfig (ConfigName,ConfigValue) VALUES
    (N'DataProviderType',N'CuteChatControls.CustomDataProvider,CuteChatControls')
    INSERT CuteChatConfig (ConfigName,ConfigValue) VALUES
    (N'UserAdapterType',N'CuteChatControls.CustomUserAdapter,CuteChatControls')
     
    I am pretty sure CuteChat somehow caches these config values. When an error occurs at startup, CuteChat does not cache these config values and all continuing requests cannot be handled. Most probably, CuteChat tries to execute the custom methods in global.asax which is the default, but they are not present.
     
    To sum up two reasons cause CuteChat have the problem described in this thread:
    - our special way of integration implementing custom integration methods somewhere else than in global.asax.
    - windows authentication to access database which fails at every iis reset (Not the main reason, just makes error occur more frequently!!)
     
    The reason why we always have this issue when iis is restarted, is that the database is accessed using windows authentication. Every request thread is impersonated to the identity of the current user before accessing the database. However, when iis is reset, the identity is lost and the thread takes the identity of the network service which cannot access our database. When i switched from windows to sql authentication i no longer had the problem. However, due to a our special environments using windows authentication is a must. Furthermore, even if sql authentication is used, if the connection to the db fails (due to a network error for example) at startup time, CuteChat will also fail! Therefore i am still looking for a different solution. Here are my questions:
     
    - Is it possible to set the CustomUserAdapter etc, in the config.file instead of having to execute the two above insert statements?
    - Will there be a new version, that can recover when the configuration is not properly initialized (due to a database error)?
    - Are there any other ways to tackle this problem?
     
    Thanks in advance for any answer.
     
    Daniel
     
View Complete Thread