• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Is session is a strange thing?

 
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

Please try to address the all points, I will be very helpful for me.if you found anything is wrong ,then guide me in proper way.


I am very confused about the idea of session, reason for this is I read many article so please do not ask me to refer any books or article.

Actually what are the use of session in any web application or distributed application.

1) How the data of a user is saved from other user�s interaction, to preserve the data from other users, It should be saved into session object?

2) stateless session and statefull session beans use session object to preserve data of a client

3) In any web application or distributed application, if data needed until the client quit from the application then where the data will be saved?, whether it is in session object?

4) As per my understanding only data are unique to a client over others. I explain it as follow

For example, in a interest calculator if client enter the amount and period then it will output the interest rate, when many users access the application and enters different data then output will vary for each users.

so data of each users should be saved. Please suggest how it is implemented in application

In stateless session bean ,what the "session" refers?.

Stateless bean does not maintain a conversational state for a particular client,then why it bear "session" in it.Why I can't say this as "Stateless bean" ?.
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) Yes, it is saved in the session object.
2) No. Stateless session beans don't save any user state. Stateful session beans do store state, but not in the user session. At least not directly.
3) Yes. The session is a good spot for data like that.
4) Yes. You would want to put each user's data into their own session to avoid the scenario you described.

> In stateless session bean ,what the "session" refers?.
Nothing. A stateless session bean does not have a session. I don't know what the word "session" refers to there. It's an interesting question.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In stateless session bean, what the "session" refers?.



There are two types of Session Enterprise JavaBean. One maintains "state" and the other does not maintain "state".

A user sits at a desk and uses a software application for 10 minutes. The user had a "session" with the application. During his/her session with the application, he/she executed some type of business logic in the application. The application's developer wrote the code that contains the logic in a "Session" EJB.

There are other types of Enterprise JavaBeans. There are "Entity" Enterprise JavaBeans and there are "Message-Driven" Enterprise JavaBeans. These other types of EJB are for different things other that handling business logic and user "sessions" with the application.

The word "Session" is an adjective that describes a certain type of Enterprise JavaBean. This helps distinguish it from the other types, e.g. Entity, Message-Driven.

The javax.servlet.http.HttpSession class and a Stateful Session Enterprise JavaBean are not the same. The "state" of a Stateful Session Enterprise JavaBean is not stored in a HttpSession object.

Hope this helps!
[ October 17, 2008: Message edited by: James Clark ]
 
jacob deiter
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all,

The javax.servlet.http.HttpSession class and a Stateful Session Enterprise JavaBean are not the same



then please explain how session bean ,maintain its session?
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

then please explain how session bean ,maintain its session?



Stateful Session Enterprise JavaBeans do not maintain "session". They maintain "state", which is why they are described with the term "stateful".

The "state" is maintained by the EJB Container.
[ October 17, 2008: Message edited by: James Clark ]
 
I didn't like the taste of tongue and it didn't like the taste of me. I will now try this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic