New Posts New Posts RSS Feed: Persistence Manager in a web farm environment
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Persistence Manager in a web farm environment

 Post Reply Post Reply
Author
jozza View Drop Down
Newbie
Newbie


Joined: 11-Jul-2007
Posts: 25
Post Options Post Options   Quote jozza Quote  Post ReplyReply Direct Link To This Post Topic: Persistence Manager in a web farm environment
    Posted: 31-Mar-2008 at 9:15pm
Hi
 
I've read in another forum post that the Persistence Manager in non-serializable, yet it seems that the common implementation is to store a new instance of a Persistence Manager in the Session for each new session. This solution however does not work in a web farm enviroment where the session is stored out of process either on a state server or in sql. What other options are there in order to get devforce working in such an environment?
 
Cheers
 
Jacob
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 01-Apr-2008 at 3:39pm
Jacob,
 
I had one customer who wanted a web farm for his ASP.NET application.  He wanted a sql or state server so that he could fail over his application
 
I suggested two alternatives:
 
(1) You are correct,  The PersistenceManager os not serializable.
 
Persist the EntitySets in the Cache.  An EntitySet is serializable
 
(2) Always flush the Entity Cache to the database.  This works, but basically gives up on using the Cache and gets everything from the database.
 
In the end, we convinced the customer the needs of his application could be handled sufficiently by using session state and that there was no good solution using a sql or state server,
 
David
Back to Top
jozza View Drop Down
Newbie
Newbie


Joined: 11-Jul-2007
Posts: 25
Post Options Post Options   Quote jozza Quote  Post ReplyReply Direct Link To This Post Posted: 01-Apr-2008 at 4:15pm
Thanks David
 
That isn't really the news that I was hoping for :( When you say "Persist the EntitySets in the Cache" which cache are you actually refering to? Do you mean Session? Do you have any example code?
 
If the webfarm was set up to use session affinity then it would probably be possible to store the persistence manager in the Session and keep it in process so it doesn't need to be serialized out to SQL or State Server. The disadvantage of this of course is that it provides less fault tolerance than 'no affinity' since if the server goes down, the user loses their session.
 
Thanks again
 
Jacob
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 02-Apr-2008 at 9:12am

Jacob,

Your comment that "it would probably be possible to use session affinity" is an understatement.  That, in fact, is exactly how the AspDataSource works,
 
You can't save the entire state of the Peristence Manager to a State or SQL Server because the PersistenceManager is not serializable, but there is some important information that can be serialized.  In particular, you should be able to persist the Persistence Cache (in Session state) to an Entity Set (pretty much the same way it is done in a disconnected application).
 
David
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down