• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Sessions

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am a little confused about sessions so if anyone has some info to share please pass it on!
Thanks in advance!
SCJP2
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you referring to session beans?? or.. what are you confused about?
cheers
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Aaron,
I'm assuming that you are referring to Session EJBs, since this forum is for J2EE and EJB. Well, from the top of my head, i can tell you that there are two main EJBs Session and Entity. Now, if we are taling about Session EJBs ( and not just a regular 'Session Bean'), then there are two other parts. There is the Stateful and Stateless Session EJBs. Basically, the Statefull has more overhead than the Stateless, over the network , because it has to remember states ( or carry data) as the client walk through certain webpages from the page that implicitly invoked or created the Stateful Session. Well, if you are asking when is best to use what? Well, ideally we would want so use stateless for all our needs. However, the stateless is good when you want to say invoke another page or update the current page with new data base on internal infomation or static links etc. But, if let say you need to retrieve data from the client from a series of say, 5 pages and then return the result base on what the user have given you. Well, the Statefull bean is useful here to help remember what the use had entered through those 5 pages, before you know what data to retrieve from the DB tier and calculate and return the results. However, this Statefull bean have to keep its states in the EJB pool (sorta like the String pool ) until it is no longer needed, and its states will reset for another use. If you want to know why we should use EJB Session instead of say the regular session, that's sorta another topic. But if you read up on EJB designs, you will notice that there is something like a regular session bean calling the EJB Session Beans or Entity Beans. Anyways, I hope this short and unprofessional introduction to EJB session was a little helpful.

Cheers,
Long Aaron Huynh
SCJP2
[ July 22, 2002: Message edited by: Long Huynh ]
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.....and if you are asking about HttpSessions, they are a way for you to persist objects between servlet requests. a session is just a hashtable of objects kept by the app server for retrival. Very simple and useful as Servlets are shared by all requests that come in(usually), so thier class level variables are essentially static.
 
Aaron O'Brien
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow,
That was pretty helpful! Thanks alot...maybe any of you would have some URLs that would be useful for me to get farther in depth with this subject?! Thanks again!
Aaron SCJP2
 
Destroy anything that stands in your way. Except this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic