Skip to Content
author's profile photo Former Member
Former Member

Stateful and Stateless BSP Application

Hi Experts,

I would like to know what a stateful/Stateles BSP Applicaiton means. I read the description given in help file but couldn't get the full idea behind it. Could anyone give a practical example for the same and explain. Thanks.

Regards,

Prabaharan

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Jul 28, 2006 at 07:42 AM

    A stateless application means that data is not kept in memory between different pages. Which means you have to do the session mamagement yourself (ie. by using server side cookies)

    Statefull means that the attributes of the application class are kept in memory during the entire http-session.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2006 at 03:14 PM

    Hi,A stateful BSP application is executed like a normal SAP transaction, – independent of all user interactions - in one single context (roll area). This means that data specified by the user during the application execution or data determined by the application itself is available potentially throughout the entire execution duration of the session.

    Since the HTTP protocol itself operates in stateless mode and knows no implicit mechanism to assign independent requests to a common logical session, the BSP runtime uses Session Cookies to group requests into one common session. The name of the cookie is sap-contextid, the validity area is restricted to the URL of the BSP application. This means that a BSP application can be executed within a browser only once at any one time. Different BSP applications can operate in parallel in the same browser. Multiple users/browsers can execute the same BSP application in parallel as often as required.

    Advantage

    The main advantage of stateful BSP applications is that they are simple to program. As usual, you have access to data determined previously and reading or re-calculating data can often be omitted. For database-intensive applications, this can lead to considerably better system performance compared to a procedure where identical read operations have to be executed for every request.

    Disadvantage

    This significant advantage is at the same time however a disadvantage – the improved runtime is offset by a larger memory requirement. The number of possible parallel sessions in an SAP Web Application Server is restricted not least by the amount of available memory space. When this space is exhausted, no further sessions can be started and users cannot log on

    Stateless BSP applications only block resources on the SAP Web Application Server during the time one single request is being processed. When the request has been processed, all resources in particular the application context are returned to the system for use in other requests.

    Stateless applications allow - at least from the viewpoint of the memory resource – optimal scaling regardless of the number of users. On the other hand, releasing the application context after every request may mean that identical data is read from the database and formatted multiple times. In this respect, the runtime may offset the memory saving. This should be evaluated and analyzed on a case by case basis.

    Rule of Thumb: Stateful or Stateless?

    As a rule of thumb, it is recommended that Internet scenarios used at the same time by a large number of users operate in stateless mode. Stateful programming is recommended for more complex applications that are used by a limited number of users in parallel and that operate with data that is expensive to determine.

    hope this helps.

    regards,

    keerthi.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 30, 2006 at 09:14 PM

    Hi,

    Go through the link,

    http://www.sapdevelopment.co.uk/webapps/bsp/bsp_stateful.htm

    Regards,

    Azaz Ali.

    Message was edited by: Azaz Ali

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 08, 2007 at 09:35 PM

    Explanations and links were very explanatory. Thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.