Question State-Reset vs State-Aware example

ankit_jkt

New Member
Hi,
I am aware about the theoretical difference between State-Reset and State-Aware operating mode of Appserver but not able to figured out any example how State-Reset reset its context once disconnected from client and State-Aware maintain context even disconnected from client for future connection.

It will be a great help if someone provide me some piece of code where I can see the difference.


Thanks
Ankit Kumar
 

RealHeavyDude

Well-Known Member
You should not waste much time trying to understand the difference between state-reset and state-aware. IMHO they are obsolete in a modern environment - and only subject of academic discussions nowadays - therefore I doubt that you will get much code examples. These are discussions I was involved in when I delivered trainings for the Progress AppServer @ the beginning of the 2000's - some 15 years ago. Those were the times were pessimistic locking and statefulness were widely understood and implemented concepts and most programmers were afraid or reluctant to concepts like optimistic locking and concurrent access to the same resources. Goodby client/server - welcome n-tier application architecture.

At least you should go for stateless, depending on your application, but most likely to state-free. Both of them, state-reset and state-aware, are stateful - meaning you are binding resources on the server at connection time mostly leaving them idle but locked and therefore limiting the scalabitliy of the system dramatically - whereas the stateless and state-free modes only bind resources on the server per request and therefore much better support scalability.

Nevertheless,

  • With state-reset the context you generate in the AppServer session is removed and not available to you unless you persistently store it ( for example in the database or an OS file ) before you disconnect and restore it when you connect. But, you need to be aware that this "removing" of context does not mean that every persistent procedure you start or dynamic handle-based object you create will be removed magically. You need to take care of them in your code or you are producing memory leaks even on a state-reset AppServer.
  • With state-aware the context you generate in the AppServer session remains. Nevertheless you might have a hard time using it since you need the examine its contents and the state it is in before you can decide whether it is useful to you. The innocent idea behind it is that you would not need a context management. In reality I did not encounter any scenario that did not need context management in an n-tier application, regardless of the operating mode of the AppServer - so state-aware to me only remained a theoretical possibility.

Heavy Regards, RealHeavyDude.
 
Top