Stateful Session Bean accesed by two JSPs.

Hi there,
We are having quite an issue; we have an application that stores session
state in an stateful session bean. And we have noticed some parts of the
application create a situation where is possible that two frames -and so two
jsp- access the session bean at the same time. And, of course, it´s going to
be the same instance of the session bean..... what will be the behaviour in
this case?. Will the requests be serialized, an exception will be thrown or
the EJB will be destroyed?. Not very sure of what would happen. I suppose
there could be some problems with this-. I would appreciate any help.
Many thanks. Best regards.

Hrm. EJB spec is quite clear on what will happen (RemoteException thrown) if
the second client attempts to use Stateful Session bean which is already in
use (and the bean will not be destroyed - container will simply throw an
exception after failing to acquire a lock on the bean instance without waiting
(allow-concurrent-calls option in WebLogic allows client call to wait to acquire
lock - this was probably added as a convinience feature for applications which
use frames)).
So, normally your application has to ensure that no 2 clients are able to use
the same stateful session bean concurrently, or use allow-concurrent-calls option,
which will do that for you, but the application will become non portable.
Dimitri
PS: Thanks. Maine Coon cats are the best. Ours is a 22-pound giant ;-)
Pinklon Thomas <[email protected]> wrote:
Hi Dimitri,
Thnaks a lot for the help:one thing that I do not know if it´s an issue is
that calls come from different JSPs; the strategy I have seen in another Web
application servers is trying to activate the EJB in the middle of another
transaction... In this situation, the container cannot activate the EJB,
roolback the transaction and destroys the EJB.... Would Weblogic feature
avoid this?. I will investigate on my part....
Many many thnaks. Nice cats.
"Dimitri Rakitine" <[email protected]> wrote in message
news:[email protected]...
In 6.1 you can set allow-concurrent-calls to true in this situation:
<!--
The allow-concurrent-calls specifies whether a stateful session bean
instance will allow concurrent method calls. The value of this
element may be either "True" or "False". The default value is
"False". When a stateful session bean instance is currently in a
method call and another (concurrent) method call arrives on the
server, the EJB specification requires that the server throw a
RemoteException. By default, allow-concurrent-calls is false, and the
EJB container will follow the EJB specification. When this value is
set to true, the EJB container will block the concurrent method call
and allow it to proceed when the previous call has completed.
Used in: stateful-session-descriptor
-->
Pinklon Thomas <[email protected]> wrote:
Hi there,
We are having quite an issue; we have an application that stores
session
state in an stateful session bean. And we have noticed some parts of the
application create a situation where is possible that two frames -and sotwo
jsp- access the session bean at the same time. And, of course, it´sgoing to
be the same instance of the session bean..... what will be the behaviourin
this case?. Will the requests be serialized, an exception will be thrownor
the EJB will be destroyed?. Not very sure of what would happen. Isuppose
there could be some problems with this-. I would appreciate any help.
Many thanks. Best regards.--
Dimitri

Similar Messages

  • How to get the Stateful Session bean instance in the second call

    Hi,
    I am new to EJBs. I have made a Stateful session bean on the first jsp page. In this page i am setting certain member variables of the EJB. Now in the second page i want to get these stored values in the EJB.
    In the second page do I...
    1. Store the instance of Remote Interface in the Session Context of the first JSP page and then in the second page get the Remote interface stored in its session context and call the business functions to get the values. If this is the case then what do u mean by Stateful Session beans??
    P.S.- This works fine.
    2. Try to get the Remote interface of that particular instance of the EJB(in which the values were stored) and call its business functions. IF this is possible. How do i do it??
    thanks in advance
    Anurag

    Hi,
    thanks for information. But i have one question. In a stateful session bean why do we have to store the Remote Interface on the client side.
    I expected in the second jsp page when i do a lookup or create, the container/server should find out whether there is a session bean already created for this session if yes, then return that particular instance of the session bean else create a new one.
    If this is not a possible case then a stateful session bean is nuthing but an instance of an object in the EJB container which does not get destroyed unless there is a time out or the remove method is called. It has nuthing to do with session because throughout the session I have to store the remote interface in the session context of the client( the client here means the jsp).
    thanks in advance
    Anurag

  • SAME EJB 3.0 Stateful Session bean for different JSP sessions returned

    Forum,
    I have a strange problem utilizing stateful session beans. Please note, that I am using jdeveloper for the following:
    1) Here is a basic stateful session bean:
    @Stateful(name = "DemoClass")
    public class DemoClassBean implements DemoClass,
               DemoClassLocal, SessionSynchronization {
          public static int id=0;
          public DemoClassBean() {
          id++;
          public int getId() {
             return id;
          //... other methods
    }2) This bean is accessed from a JSP for testing purpose, I am copying only the script used in JSP:
    <%
       DemoClass bean = null;
       try {
          bean = (DemoClass) ((new javax.naming.InitialContext()).
                       lookup("DemoClass "));
          System.out.println("ID=" + bean.getId() );
          } catch (javax.naming.NamingException e) {
             // TODO
    %>If this page is addressed by different clients, from different browsers, the same bean is returned.
    Here is what I see in the logs:
    ID=1
    ID=1
    ID=1
    The same problem is being observed when this session bean is accessed from a JSF Backing bean.
    What could be wrong? Is this a bug in oc4j / jdeveloper (version 10.1.3.3.0)?
    Edited by: smw000000001 on Nov 17, 2008 10:52 AM

    Hi,
    The code for stateful is perfectly fine and working in a normal way. The way you are trying to implement the stateful session bean in your application is wrong.
    think of binding the stateful session bean with HttpSession object.
    So that you will get a unique stateful session bean object.

  • "Sharing" a stateful session bean between two servlets, beans

    Hello!
    I just started to learn some java ee programming and was wondering how i would share one stateful session bean between two servlets.
    I created the bean with @Stateful.
    I tried to inject the stateful bean in both servlets by @EJB and i can manipulate the object, but each servlet seems to have its own object.
    The bean has a remote interface that it implements.
    What i also tried was to add the mappedName to the @Stateful expression. Something like: @Stateful(mappedName="name") and to use the bean by @EJB(mappedName="name") but it had no effect.
    Im using glassfish 2.1 with netbeans 6.7.1 as my environment (standard settings)
    dummy question, but i googled like hours and couldnt find anything : \
    hope someone can help and sorry for my bad english
    greets and thanks

    Hi there!
    I think you are searching for something like an application wide singleton. There is the possibility to define such one in the Glassfish admin console.
    Hope this helps!

  • Lock Timed out exception in stateful Session Bean

    Hi All,
    We have a stateful session bean and put the reference of the bean in HttpSession
    and retrieve it from other JSP.
    While calling a method from bean, we are often getting the following exception.
    Any help please?
    weblogic.ejb.extensions.LockTimedOutException: Lock for primaryKey:1018581328443_46
    could not be acquired without waiting.
    at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:134)
    at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
    at weblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:447)
    at weblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObject.java:159)
    at weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:487)
    at com.elink.jbe.savejobses.SaveJobSesBeanEOImpl.getJobHeaderData(SaveJobSesBeanEOImpl.java:1258)
    at jsp_servlet._jobentry._jbeenquirydefaults._jspService(_jbeenquirydefaults.java:243)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:123)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:761)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:708)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)

    Hi Arjuna,
    Thanks for your suggestions. But can you also help me how to make the session
    bean thread safe?
    Thanks in Advance
    Srinath
    "Arjuna Chala" <[email protected]> wrote:
    Looks like you have two threads accessing the bean at the same time.
    You
    need to make it thread safe. Also, store the handle of the session bean
    instead of the session bean itself in the session.
    By the way, session beans (handle or otherwise) are not meant to be stored
    in the HttpSession, and here is why:
    http://groups.google.com/groups?q=stateful+session+bean+httpsession&hl=en&se
    lm=3b72acb9%40newsgroups.bea.com&rnum=6
    "srinath" <[email protected]> wrote in message
    news:[email protected]...
    Hi All,
    We have a stateful session bean and put the reference of the bean inHttpSession
    and retrieve it from other JSP.
    While calling a method from bean, we are often getting the followingexception.
    Any help please?
    weblogic.ejb.extensions.LockTimedOutException: Lock forprimaryKey:1018581328443_46
    could not be acquired without waiting.
    atweblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:134)
    atweblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
    atweblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:447)
    atweblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObjec
    t.java:159)
    atweblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:487)
    atcom.elink.jbe.savejobses.SaveJobSesBeanEOImpl.getJobHeaderData(SaveJobSesBea
    nEOImpl.java:1258)
    atjsp_servlet._jobentry._jbeenquirydefaults._jspService(_jbeenquirydefaults.ja
    va:243)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :123)
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:761)
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:708)
    atweblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java:252)
    atweblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
    atweblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)

  • How to track the stateful Session Bean?

    Hi all,
    Am in a serious trouble. I have a message driven bean which will get initiated when some message gets dumped into the queue. I have got session bean which i use to process message which my message driven bean takes from the queue.
    My problem is, lets say there are 3 msgs in the queue. lets say the messages be "aaaa", "aaaa" and "bbbb".
    In this case, when i read the first message, i will create an instance of the session bean to process the message "aaaa". When i receive the second message still i create an instance to process the message "aaaa". When i get the 3rd message, i create an instance to process the message "bbbb".
    My problem in this is, i want to create only one instance of session bean for the message "aaaa".
    So once i create the instance for session bean for particular message, i need to store the object or something of the instance which i created along with the message. Please help me with what i can store with which i can reffer to the session bean again.
    Please see the sample code too.
    Thanks in advance,
    Ashly
    if(msg.equals("aaaa"))
    First n;
    Object obj = ctx.lookup("ejb/First");
    FirstHome home = (FirstHome) PortableRemoteObject.narrow(obj, FirstHome.class);
    n = home.create(msg);
    }

    Hi,
    thanks for information. But i have one question. In a stateful session bean why do we have to store the Remote Interface on the client side.
    I expected in the second jsp page when i do a lookup or create, the container/server should find out whether there is a session bean already created for this session if yes, then return that particular instance of the session bean else create a new one.
    If this is not a possible case then a stateful session bean is nuthing but an instance of an object in the EJB container which does not get destroyed unless there is a time out or the remove method is called. It has nuthing to do with session because throughout the session I have to store the remote interface in the session context of the client( the client here means the jsp).
    thanks in advance
    Anurag

  • Reentrant call to a stateful session bean

    Hi,
    I have a problem that seems to be a very common problem but I
    steel didn't find any solution for it.
    We have a jsp page that call to stateful session been, the
    problem occur when I click twice on any link/button then I get
    java.rmi.RemoteException: Illegal attempt to make a reentrant call to a stateful
    session bean from home:....
    I have tried to set the <allow-concurrent-calls> to true but it doesn't help,
    I am getting this exception no matter the value of this tag.
    I am using WL61 sp2 (the last version) , Does anybody find a solution for that,
    I don't want to use javascript in order to work around this problem.
    Thanks,

    I think this is a different error from concurrent access (when client's
    attempt to access the same bean concurrently WebLogic throws LockTimedOut error
    (or client blocks if allow-concurrent-calls is true)).
    This error probably means that your code attempetd to reenter bean in the same
    transaction - how do you invoke it and what is the stack trace?
    Haim Cohen <[email protected]> wrote:
    Hi,
    I have a problem that seems to be a very common problem but I
    steel didn't find any solution for it.
    We have a jsp page that call to stateful session been, the
    problem occur when I click twice on any link/button then I get
    java.rmi.RemoteException: Illegal attempt to make a reentrant call to a stateful
    session bean from home:....
    I have tried to set the <allow-concurrent-calls> to true but it doesn't help,
    I am getting this exception no matter the value of this tag.
    I am using WL61 sp2 (the last version) , Does anybody find a solution for that,
    I don't want to use javascript in order to work around this problem.
    Thanks, --
    Dimitri

  • Passivation of Connection Object in Stateful Session Bean

    Hi all,
    I am developing a Stateful session bean that has a Connection object as its instance variable. And this bean starts transaction that spans across multiple method calls and finally either commit or rollback.
    BeanClass
    UserTransaction utx;
    Connection conn;
    ejbCreate()
    allocateconnection();
    ejbRemove()
    closeconnection();
    ejbActivate()
    allocateconnection();
    ejbpassivate()
    closeconnection();
    StartTransaction()
    utx = getusertransaction();
    utx.begin();
    Method1()
    do something with database
    Method2()
    do something with database
    CommitTransaction()
    utx.commit();
    For example, the typical usage of this bean would be:
    bean.StartTransaction();
    bean.Method1();
    bean.Method2();
    bean.CommitTransaction();
    Here are my two questions:
    1. General Question: In order for a Connection object to join a Transaction, Do I have to create the connection after the transaction has started?
    2. If the answer to the above question is yes, then: I understand that when this bean get passivated, the UserTransaction instance object would be passivated. And since the connection object can't not be passivated, I have to recreate the connection object in ejbactivate() method, would newly created connection participate in the same Transaction that was being passivated and now activated?

    >
    Hi all,
    I am developing a Stateful session bean that has a
    Connection object as its instance variable. And this
    bean starts transaction that spans across multiple
    method calls and finally either commit or rollback.
    BeanClass
    UserTransaction utx;
    Connection conn;
    ejbCreate()
    allocateconnection();
    ejbRemove()
    closeconnection();
    ejbActivate()
    allocateconnection();
    ejbpassivate()
    closeconnection();
    StartTransaction()
    utx = getusertransaction();
    utx.begin();
    Method1()
    do something with database
    Method2()
    do something with database
    CommitTransaction()
    utx.commit();
    For example, the typical usage of this bean would be:
    bean.StartTransaction();
    bean.Method1();
    bean.Method2();
    bean.CommitTransaction();
    Here are my two questions:
    1. General Question: In order for a Connection object
    to join a Transaction, Do I have to create the
    connection after the transaction has started?Strictly NO. In fact, the connection is obtained first and then can a transaction begin.
    2. If the answer to the above question is yes, then: I
    understand that when this bean get passivated, the
    UserTransaction instance object would be passivated.
    And since the connection object can't not be
    passivated, I have to recreate the connection object
    in ejbactivate() method, would newly created
    connection participate in the same Transaction that
    was being passivated and now activated?
    The answer to first question being NO, your argument for question 2 does not hold true. According to the EJB specification, a stateful session bean can only be passivated between the transaction and not within a transaction. Your implementation for the stateful EJB is good to work.

  • Stateful session bean and faces

    I have one stateful session bean(EJB) that manages business logic and conditional page flow. In the web part i have a bunch of JSP pages and each page has it's own JSF bean with data and "submit" methods. Each bean has to keep a reference to this stateful bean and it should be the same reference among all beans. Also i have to create and destroy this bean some way (I think i can use HttpSessionBindingListener).So, any suggestions how to do this? Also i'm searching for 'tips'n'tricks' or design pattern for JSF.
    anton

    why do you need to hold the same EJB reference in all your JSF beans?
    something is wrong with your design, you should take a closer look to see why you need this. a stateless bean does not hold client specific state and there is no difference between stateless bean instances, so your JSF beans do not have to point to the same EJB reference.

  • Stateful session bean

    I am creating a web application using JSPs and want to keep stateful information from one call to the next.  In the first jsp I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    In the second JSP I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    out.println("<hr>Username get<br>");
    out.println(testbean.getUsername());
    out.println("<hr>");
    The second JSP always prints null for the username.  I always thought when creating a stateful session bean, it looks for an instantiated class that is tied to the client and then if it isn't found, creates a new class.  It appears to always be creating a new object.
    Every example I see, shows then creating the stateful and then stuffing it into the session.  Is this really the way to do it?

    I am creating a web application using JSPs and want to keep stateful information from one call to the next. In the first jsp I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    In the second JSP I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    out.println("<hr>Username get");
    out.println(testbean.getUsername());
    out.println("<hr>");
    The second JSP always prints null for the username. I always thought when creating a stateful session bean, it looks for an instantiated class that is tied to the client and then if it isn't found, creates a new class. It appears to always be creating a new object.
    Every example I see, shows then creating the stateful and then stuffing it into the session. Is this really the way to do it?

  • Stateful session bean destroying instance variables?

    I'm trying to use a stateful session bean as some kind of login controller and to maintain the login id and access level across JSPs and HTMLs so that once logged in, all the JSPs can obtain the login name of the current user (String) and his access level (int).
    I use the login.jsp to login and it successfully reports logging in with the correct access level retrieved from database. However, if I go to another JSP (testlogin.jsp), these 2 EJB instance variables are always destroyed and set to null and 0 when I access them again.
    What am I missing that my stateful session bean is not saving these instance variables? Do I need to put them in some serializable value objects (create a help VO class?)
    I suspected that on different JSP, I call the MemberControllerHome.create() method, it creates a new instance or something but if I don't use the create method how do I get a handle to MemberController at all?
    MemberControllerBean.java
    public class MemberControllerBean implements SessionBean {
         //initialize in ejbCreate.
         private MemberHome memberHome;
         SessionContext context;
         //Member currentLogin;
         //Current Login
         private String loginID;
         private int accessLevel;
         // Constructor
         public MemberControllerBean() {}
    ...some code in between...
    public void login(String id, String password){
              try{
                   Member member = null;
                   member = memberHome.findByPrimaryKey(id);
                   if(member.getMPassword().equals(password)){
                        this.loginID = member.getMID();
                        this.accessLevel = member.getMAccessLevel();
                   else{
                        throw new EJBException("Login failed. Invalid member ID and/or password.");
              } catch (FinderException ex) {
                   throw new EJBException("Login failed. Invalid member ID and/or password.");
         public void logout(){
              this.loginID = null;
              this.accessLevel = 4;
         public String getLoginID(){
              return this.loginID;
         public int getLoginAccessLevel(){
              return this.accessLevel;
    login.jsp
    String mID = request.getParameter("mID");
    String mPassword = request.getParameter("mPassword");
    out.println("20:" + mID + ":" + mPassword);
    if(mID != null && mPassword != null){
         out.println("22:" + mID + ":" + mPassword);
         try{
              InitialContext ic = new InitialContext();
              MemberControllerHome home = (MemberControllerHome) ic.lookup("java:comp/env/ejb/MemberController");
              MemberController mc = home.create();
              out.println("26:Logging in as " + mID + " with " + mPassword);
              mc.login(mID, mPassword);
              out.println("28:" + mc.getLoginID() + "logged in successfully at level " +
                   mc.getLoginAccessLevel() + ".");
         } catch (NamingException ex) {
              out.println("java:comp/env/ejb/MemberController not found.");
         } catch (EJBException ex) {
              out.println(ex.getMessage());
         } catch (Exception ex) {
              out.println(ex.getMessage());
    testlogin.jsp
    <%
    try{
         InitialContext ic = new InitialContext();
         MemberControllerHome home = (MemberControllerHome) ic.lookup("java:comp/env/ejb/MemberController");
         MemberController mc = home.create();
         out.println("You are logged in as <b>" + mc.getLoginID() +
              "</b> at level <b>" + mc.getLoginAccessLevel() + "</b>.");
    } catch (NamingException ex) {
         out.println("java:comp/env/ejb/MemberController not found.");
    } catch (EJBException ex) {
         out.println(ex.getMessage());
    } catch (Exception ex) {
         out.println(ex.getMessage());
    %>

    The key to the problem is that in testlogin.jsp a new stateful session bean is created. The new bean instance of course doesn't know the log-in information you stored in the old session bean. That is why the method returns null and 0 when called.
    There are couple of ways to solve the issue. The easiest solution is to store the bean instance created in Login.jsp in the jsp's implicit HttpSession object. Because login.jsp and testlogin.jsp share the same session, the bean instance can be easily stored and retrieved.
    Here is the code you need to have:
    1. in login.jsp
    session.setAttribute("MemberControllerBeanInstance", mc);
    2. in testlogin.jsp
    MemberController mc =
    (MemberController) session.getAttribute("MemberControllerBeanInstance");
    Hope it helps.

  • Local Stateful Session Bean State Failover Cluster

              Hi,
              How are you doing? I have poured through the previous postings and still am unclear
              on the following: If we have a stateful session bean that is local is the state
              replicated in a cluster if we are using in-memory replication?
              What controls when the state is replicated? Transactions?
              What happens if the methods are not transacted? Is the state replication at the
              method level?
              Thank you so much,
              -Bart Simpson
              

    Hi Bart,
              I'm a bit unclear on it too. It's been asked before, but no definite answer
              has been provided.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "Bart Simpson" <[email protected]> wrote in message
              news:[email protected]..
              >
              > Hi,
              >
              > How are you doing? I have poured through the previous postings and still
              am unclear
              > on the following: If we have a stateful session bean that is local is the
              state
              > replicated in a cluster if we are using in-memory replication?
              >
              > What controls when the state is replicated? Transactions?
              >
              > What happens if the methods are not transacted? Is the state replication
              at the
              > method level?
              >
              > Thank you so much,
              > -Bart Simpson
              

  • [EJB] Stateful session bean--- strange error

    hi guys,
    here s my problem. i m trying to developp a stateful session bean with two ejbcreate method. one with parameters ( ejbcreate(int val)) and another one without (ejbcreate()).
    The client can call ejbcreate without any pbs. everything s allright.
    but when i try to get a remote access to the bean via a
    MY_BEAN.create(5); then i got an error saying :
    FAILED TO FIND METHOD FOR HASH ......
    i dont understand cuz i checked my files many times and the two methods are implemented and declared in the home interface.
    what should i do ?
    please.
    tery

    Hi Tery,
    You are in the wrong forum. This forum is for the Sun Java Studio Creator.
    Cheers :-)!!!

  • HttpSession vs. Stateful Session Bean ---- when State Session is large

    I hope most of the people come across with this issue where to put the state
    for the internet/intranet based applications when they are using
    servlet/jsps calling session beans. Weblogic 4.5.1 does support httpsession
    in-memory replication for the servlets but the stateful session beans are
    not replicated in clustered environment. Plus with stateful bean u get
    activation/passivation overhead too. So one tempts to use stateless session
    beans and store state in httpsession?
    Then what is the upper limit for the session state one can put in
    HttpSession with the weblogic? Is there any way to configure it?
    One way to overcome the httpsession size limitation is to use database for
    storing state and just store some unique Ids for the session info in
    httpSession. But then there will be overhead for database connection?(jdbc
    connection pool can provide some help here). So what is the recommended way
    for doing this provided few thousand concurrent clients with session size
    say exceeding 4kb per client?
    Thanks
    Usmani

    There are no special setting in sun-ejb-jar.xml regarding cache settings. The default settings from server.xml are used:
        <jdbc-connection-pool steady-pool-size="8" max-pool-size="32" max-wait-time-in-millis="60000" pool-resize-quantity="2" idle-timeout-in-seconds="300" is-isolation-level-guaranteed="false" is-connection-validation-required="false" connection-validation-method="auto-commit" fail-all-connections="false" datasource-classname="oracle.jdbc.pool.OracleDataSource" name="ebs">
          <property value="jdbc:oracle:thin:@myebsdbsserver:1521:ebsdevdb" name="url"/>
          <property value="ebs" name="user"/>
          <property value="ebs" name="password"/>
        </jdbc-connection-pool>
      <ejb-container steady-pool-size="32" pool-resize-quantity="16" max-pool-size="64" cache-resize-quantity="32" max-cache-size="512" pool-idle-timeout-in-seconds="600" cache-idle-timeout-in-seconds="600" removal-timeout-in-seconds="5400" victim-selection-policy="nru" commit-option="B" monitoring-enabled="true">
         </ejb-container>The Session Bean uses Container Managed Transaction. Is it possible in this case, that the bean isn't 'idle enough' in order to set into passivated?

  • Stateful session bean purpose?

    Currently I am struggling with the purpose of stateful session beans. Any client program should be able to maintain the state itself. Why am I using a session bean for this and loading the server with something that is really not of much value?
    Can anyone give me a good example of when I need a stateful session bean, or at least a good use for one?
    Thanks!

    The jsp can certainly save the info in the "session" object. But I can see how this would be easier.
    I have come to believe that stateful session beans just allow you to commonize your web interfaces with your non-web interfaces by abstracting lots of functionality into the EJBs.

Maybe you are looking for

  • Standby data Gurad 10g switchover problem with application

    Hi! I'm working on oracle 10g and try to make standby datagurad with same dbname eg. if my primary database name is orcl then my standby database should be orcl with same location because one of mine application is accepting only orcl not standbyorcl

  • Please help me, my Sharp LCD TV went black.

    I just bought a new Mac Mini and set it up straight HDMI to HDMI on the Sharp Aquos 37" LCD TV I had it working fine until I mistakenly tried to change the resolution. The TV went black and won't come back unless I start the Mac Mini in safe mode. I

  • How usnig manuplate the Import and export Key word.

    How usnig manuplate the Import and export Key word? and how do the clear of those variable?

  • No Improvements in KN3

    Well, I've had KN3 for a month or so now and I'm going back to PowerPoint, evean after a year of working with KN2, and the reason is simple - from a presenter point of view PPT rules simply because they let you see all the slides on the left and be a

  • What's with the multiple home screens in 11.1.4.62?

    In addition to 11 pages of home screens, some of which have only one app, I have a screen category called Finance and another called Photoggrapy. How can I change the screen names in iTunes? iPhone 5s. Windows 7. Itunes 11.1.4.62