New Posts New Posts RSS Feed: ASP.NET session state
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

ASP.NET session state

 Post Reply Post Reply
Author
scottarlp View Drop Down
Newbie
Newbie


Joined: 07-Apr-2011
Posts: 26
Post Options Post Options   Quote scottarlp Quote  Post ReplyReply Direct Link To This Post Topic: ASP.NET session state
    Posted: 11-Jul-2011 at 10:06am
I needed to switch over to SQL session state for asp.net and I've run into a problem where IB entities aren't serialized (at least the session manager doesn't think they are). So I do a normal entity manager call and get an entity set back. Trying to put this in Session throws an error "Unable to serialize the session state...".
Everything I've found so far says that you need the serialize attribute on the class and I see where there's a datacontract attribute, but I have run into problems before where I had to have both. Is there an easy way to handle this? I would hate to either call the database every time to get this data or create a dummy class to transition the entity to.
 
Thanks.
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jul-2011 at 11:33am
Scott,
 
Rather than trying to serialize the EntityManager, what you actually want to use is the EntityCacheState. You can take that cache state, store it in your session, and then restore it into your EntityManager on your next page load, thus providing the data persistence you're looking for.
 
Here's the relevant page on the DRC for using the CacheState.
 
http://drc.ideablade.com/xwiki/bin/view/Documentation/start-entity-cache#HExportcacheasanEntityCacheState
 
Yours,
Robert
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down