If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

State Persistence

Hi all,
I am trying to implement state persistence feature to my upcoming project.But where in i am completely uncertain in implementing it as a generic componet, so that every developer in our project can include these classes to implementing this feature in their modules.
State Persistence:State persistence is a process of storing the state of a user and some way of knowing where the user is within the process, as well as having somewhere to store ephemeral application information. Also, if the user suspends a task and then restarts it, their restart location and any other information must be retrievable.
I have done one sample application where i have used two procedures to implementing this.First,Using Database support everytime updating the user related id, Url and state Object in database.Latter on we found that this process is taking min.of two database hits for every page landing.Second, Using session management i used to keep all the details of user in session object and finally i am doing the databse batch updation intead of doing it everytime.This process is ok.But my problem is i want make it as a generic component.Can please guide me in this regard.If any have doubts on my issue,please feel free to ask the same.
Thanks in Advance..

State Persistant

Hi,

There is only a couple of ways that I can think of, depending upon the level of intrusiveness you want.

1. Make any class which needs to be persisted call the relevant methods in order to persist itself, probabily using a observer, observable type pattern.
In this instance you would also need to have a method of restarting the class at the given point.
I suggest in this instance that you llow the class to determine when it is interruptable.

2. Write a dynamic proxy class which can be used to detect and act on any passing events.

State Persistence issues..

Hi Graham..
Your suggested ways to maintain state persistence is nice.You are about to touch the problem rope.Let me explain my problem a bit more clearer.For example,while user is surfing something on a shopping cart web site and he is about submit the detailed order page, unfortunately he closes his browser.Here my component comes into picture,when the same user logs back in to the system, The system has to ask about his previous state to continue from that point.The system has to check whether particular user is having previous state.If yes,it has to allow the user to continue from that state.
I heared that the tomcat server have fecility to maintain the users previous state and user's previous navigation graph details.
But i don't know how i have to user the server inorder to get the result from the server.
Can u please help out in tis regard..