Why OA fails in SQL Server SessionStateMode ?

Thread is closed for posting
2 posts, 0 answers
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 18 Oct 2010 Link to this post

    HI all,

    I am having a bit of a problem. I am developing a ASP.NET based application based on telerik Open Access version 2010.2.714.1.

    Persistent classes are generated based on the existing SQL Server tables using Domain model design [Used to be reverse mapping]. I have used Repository pattern to access in DAL.

    DAL layer is in a different class project which is being referenced from ASP.NET web project. So that asp.net pages can make use of it.

    Sample Repostiory Class looks like

    namespace MyDataRepository.Admin
        /// <summary>
        /// UserRepository class implements interface IUserRepository
        /// Reponsibile for All User relates functions
        /// Eg Authentication/Authorisation, User listing 
        /// </summary>
        public class UserRepository:IUserRepository
            private MyDbContext  m_dataContext;
            public UserRepository()
                m_dataContext = new MyDbContext();
      public UserPortfolio GetUserPortfolio(User user)
                UserPortfolio userPorfolio = (from userPort in user.UserPortfolios
                                                 where userPort.UserPortfolioDefault == true
                                                 select userPort).FirstOrDefault();

                return userPortfolio;
    }//end of namespace

    On the ASP.NET side,

    I am using something like,

    if (userObj.UserPortfolios.Count>0)

    Just to inform you that userObj is a persistent class and it is using lazy loading to get UserPortfolios from "UserPortfolio" table.

    user.UserPortfolios.Count returns NullReferenceException!! when I change my session State to SQL Server in web.config but the same code work when session state is "InProc".

    Please let me know what mistake have I made and what needs to be done so that it works in both sessionState modes.

    Many thanks.


  2. Zoran
    Zoran avatar
    534 posts

    Posted 21 Oct 2010 Link to this post

    Hi M G,

     Please, find the answers for this question in the support thread that you have started for this same issue.

    Sincerely yours,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top