Load Balancing Configuration

Last post 11-21-2007, 4:36 PM by sinacode. 3 replies.
Sort Posts: Previous Next
  •  01-12-2007, 12:40 PM 25756

    Load Balancing Configuration

     
    Hello,
     
    I am having difficulty getting CuteChat to run in a load balanced environment.  I have added in to the Web.Config on each server the multple server mode setting.
    <add key="CuteChat.MultipleServerMode" value="true" />
     
    When I try to load a page or enter a chat room I receive the following message:

    Cannot insert the value NULL into column 'StateLogId', table 'Chat.dbo.CuteChatTempStateLog'; column does not allow nulls. INSERT fails.
    The statement has been terminated.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'StateLogId', table 'Chat.dbo.CuteChatTempStateLog'; column does not allow nulls. INSERT fails.
    The statement has been terminated.
     
    I am running IIS 6 on Windows Server 2003.  The Web Garden on each server is set to 1.  Is there additional configuration I am missing?
     
    Thanks,
    Greg
  •  01-12-2007, 12:41 PM 25757 in reply to 25756

    Re: Load Balancing Configuration

    Forgot to mention I am running CuteChat 3.1.
  •  01-12-2007, 2:16 PM 25760 in reply to 25757

    Re: Load Balancing Configuration

    I figured out what the problem was.  There was no identity set on the CuteChatTempStateLog table.  After turning on identity on the StateLogId field, load balancing started working properly. 
     
    Just something to watch out for when setting up a load balanced environment. 
     
    Greg
  •  11-21-2007, 4:36 PM 35287 in reply to 25760

    Re: Load Balancing Configuration

    yes, It works after turning on identity.
    it is safe to turning on the identity on StateLogId because single server don't use this table.
    only web farm model will use this table to save sessions in this table.
     
    Detailed step:
    Step 1: Turn on identity
    You can manually add identity to StateLogId column 
    If you use SQL Script:
        ALTER   TABLE   CuteChatTempStateLog   DROP   COLUMN   StateLogId 
        GO
        ALTER   TABLE   CuteChatTempStateLog   ADD   StateLogId   INT   IDENTITY(1,1)
        GO
     
    Step 2: Modify configuration (web.config)
    <add key="CuteChat.MultipleServerMode" value="true" />
     
     No need to shut down production server.
     
    Many thanks to Adam.



    http://www.cninla.com
View as RSS news feed in XML