Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9052069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:04:30+00:00 2026-06-16T13:04:30+00:00

Context Simple Java EE 6 (JBoss AS 7.1) CRUD Web App, Using a @Named

  • 0

Context

Simple Java EE 6 (JBoss AS 7.1) CRUD Web App, Using a @Named backing bean, @SessionScope of JSF pages:

Question

Why would be a bad idea to store the HTTP session stateon the CDI bean? For example, storing the shopping cart items right there.

Comments

SFSB are meant for this, due to their conversational state, but I’ve read that they are not easy to use in practice. Also I think that another option would be the HttpSession object.

I’m also aware about the passivation/activation advantage that they hold.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:04:34+00:00Added an answer on June 16, 2026 at 1:04 pm

    I think you are confused between “session” as used for the HTTP session and as used for a session with a specific bean (the stateful bean in this case).

    They serve different purposes, but also overlap. Originally, the session with a SFSB was used for non-HTTP remote clients (Applets and Swing applications). In a way you could say it was the RMI equivalent of the HTTP session.

    When there’s already an HTTP session available, it doesn’t make sense to use stateful session beans for this purpose, and you’d be better of by using HTTP session scoped beans.

    Stateful session beans do have their uses though, for instance they’re able to accommodate the extended persistence context and can keep e.g. (optimistic) locks open outside of transactions.

    When used in a Java EE 6 web application, you’d often want to assign the stateful session bean an HTTP session scope. Otherwise, even though the bean has an internal session, it’s not connected to anything but to the proxy you use to communicate with it.

    Also see:

    • Hold session in stateful EJB 3.1 bean?
    • Using a Stateful Session Bean to track an user’s session
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context I want to use JavaFx with clojure. I am aware of http://nailthatbug.net/2011/06/clojure-javafx-2-0-simple-app/ Question:
I've created very simple REST app with next web.xml: <context-param> <param-name>resteasy.scan</param-name> <param-value>true</param-value> </context-param> <listener>
I have created very simple app with persistence context (hibernate as provider) to read
I'm drawing simple text in HTML5 canvas using this: context.fillStyle = #FF0000 context.font =
I have a very simple dialog defined as: import android.app.AlertDialog; import android.content.Context; import android.view.LayoutInflater;
I'm using NetBeans IDE 6.9 (Build 201006101454), and wrote this simple Java class (that
I am trying to develop one simple application using Java, Flex and Blazeds. I
I am writing a web service using CXF and running under JBoss 6.0.0.Final. Right
I have a standalone simple java web application with servlets and jsp, say the
I would like to development an simple application using the following envirnoment. JBoss 7.1.1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.