This is a migrated thread and some comments may be shown as answers.

Why OA fails in SQL Server SessionStateMode ?

1 Answer 39 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
FISCAL
Top achievements
Rank 1
FISCAL asked on 18 Oct 2010, 05:19 PM
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.

e.g.
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.

MG





1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 21 Oct 2010, 05:55 PM
Hi M G,

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

Sincerely yours,
Zoran
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
Tags
Getting Started
Asked by
FISCAL
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or