unitofwork

Posts   
 
    
kulki
User
Posts: 26
Joined: 20-Dec-2004
# Posted on: 20-Jan-2005 05:56:18   

In a ASP.NET environment how do I use the UnitOfWork object across multiple requests? Do we have to store it in a session variable? This approach dosent sound very elegant. I was looking into using ThreadStatic() but that does not work due to the nature of how threads are managed. I tried using CallContext even that does not work. ANy suggestions?

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 20-Jan-2005 06:03:38   

Thats where I put it. But hey, it is serializable and can be passed across process boundaries, so you could send it to a remote singleton for later useage. You could save it to disk, i.e. serialization, etc. You could put it into cache, etc.

IMO, there really isnt anything wrong with using session. Thats what its there for. Just be sure to clean up after yourself when you are done.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Jan-2005 09:48:06   

I second that, session objects are there for user-state variable management. It's part of the userstate, so store it in the place where you store user-state information.

Frans Bouma | Lead developer LLBLGen Pro