Stateful vs Stateless

Hello,
I am trying to understand the difference between a stateful and a stateless bean. I have read the J2EE tutorial and the whole ejb concept is great! One problem though, I don't understand what a client-bean session is or how it works. Could someone please explain this and possibly give me a qualitative example of how it fits into both the stateful and stateless bean? This should be easy duke dollars for any ejb expert! Thanks.
Chris

hi,
stateless session cannot maintain the state of the client i.e between the method calls no client inforamation is retained. once the request is processed the container may remove the bean from the memory or it maintain the bean in the pool in order to process the requests that are coming from other clients for the same.
eg. Assume you have a business method in bean class.
public class ConvertBean implements SessionBean
public int convertCurrency(int dollars)throws RemovteException
....code
This method is just for converting one type of currency into another type. For that we need not bother about the client. For this stateless session is sufficient.
Stateful session bean maitains the state of the client i.e it retains the information between method calls.
the object exists in the memory as long as the client is communicating with the server. Its state is not permanent.
eg . shoping cart
public class CartBean implements SessionBean
protected Vector v;
public void ejbCreate()
v = new Vector();
public void addItemToCart(Object item)
v.addElement(item);
No two clients share the same stateful session bean.

Similar Messages

  • How to get stateful and stateless session bean in second jsp

    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the second jsp? I find that somebody store the bean in HttpSession.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, both stateful and stateless can maintain the state in the second jsp. What is the difference between stateful and stateless session bean in this case ?
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use session bean. Can anyone provide sample jsp to show difference of stateful and stateless? How the stateful session bean can maintain the state for the client?

    Greetings,
    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the
    second jsp? I find that somebody store the bean in HttpSession.Which is the correct scope for sharing client-specific data when 'request' scope is insufficient.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is
    that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, bothWhy is that a "problem"? Does your application not require the stateless bean to be shared? If so, then don't store the EJBObject reference in the session...
    stateful and stateless can maintain the state in the second jsp. What is the difference betweenWhat do you mean by this exactly?..
    stateful and stateless session bean in this case ?Statefulness of session beans is in regard to maintaining client state (er, in all cases). If your "stateless" bean is receiving information from the client (i.e. its caller) - either through a create method or a business method - and that information is available (retrievable from the bean) on subsequent method calls, then that bean is, in fact, stateful - regardless of how it is deployed.
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use
    session bean.The correct question, it here seems, is "when" to use which type... Use a "stateful" bean when information about (from) the client (i.e. the caller) must be maintained across method calls of the bean. Use a "stateless" bean for general business methods that do not depend on "prior knowledge" of the client (i.e. the caller).
    Can anyone provide sample jsp to show difference of stateful and stateless? How the statefulA "sample JSP" would yield nothing additional... The semantics of calling, using, and "persisting", bean references are always the same - regardless of type or class. However, the reason(s) for using one over the other depends entirely on the needs of your application.
    session bean can maintain the state for the client?I recommend that you spend more time learning about EJBs generally. In particular, it seems you require more fundamental understanding of their scope and lifecycle. Refer to sections 4, 6, and 7 of the EJB 2.0 Specification.
    Regards,
    Tony "Vee Schade" Cook

  • Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0]

    Hi,
    I am getting exception when i change the below entry from Stateful to Stateless for Transaction Type "Container"..
    ----------------------------------------------------------------Working Fine for single and multi users----------------------------------------------------
    <session>
              <description>Entity Bean Employee Example</description>
              <ejb-name>Stlg</ejb-name>
              <local-home>com..ejb.session.ejbeans.StlgHome</local-home>
              <local>com.ejb.session.ejbeans.Stlg</local>
              <ejb-class>com.ejb.session.ejbeans.StlgBean</ejb-class>
              <session-type>Stateful</session-type>
              <transaction-type>Container</transaction-type>
    </session>
    ----------------------------------------------------------------Working Fine for single and multi users----------------------------------------------------
    ----------------------------------------------------------------Working Fine for single user and exception for multi users----------------------------------------------------
    <session>
              <description>Entity Bean Employee Example</description>
              <ejb-name>Stlg</ejb-name>
              <local-home>com..ejb.session.ejbeans.StlgHome</local-home>
              <local>com.ejb.session.ejbeans.Stlg</local>
              <ejb-class>com.ejb.session.ejbeans.StlgBean</ejb-class>
              <session-type>Stateless</session-type>
              <transaction-type>Container</transaction-type>
    </session>
    ----------------------------------------------------------------Working Fine for single and exception for multi users------------------------------------------------------------
    2012-06-27 12:27:15,531 DEBUG com.ds.ApplSessListener 16 - vattributeAdded : errorencountered,java.lang.ClassCastException: java.lang.String cannot be cast to com.packg.class
    Strange that its working for single user and cracking for multiuser when tested via jmeter

    12/06/28 12:21:42 java.lang.IndexOutOfBoundsException: Index: 2300, Size: 2300
    12/06/28 12:21:42      at java.util.ArrayList.RangeCheck(Unknown Source)
    12/06/28 12:21:42      at java.util.ArrayList.get(Unknown Source)
    12/06/28 12:21:42      at com.ejbeans.StlEntryBean.getEntryList(StlEntryBean.java:1587)
    12/06/28 12:21:42      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    12/06/28 12:21:42      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    12/06/28 12:21:42      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    12/06/28 12:21:42      at java.lang.reflect.Method.invoke(Unknown Source)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    12/06/28 12:21:42      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    12/06/28 12:21:42      at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    12/06/28 12:21:42      at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    12/06/28 12:21:42      at Entry_LocalProxy_1dc72ge.getEntryList(Unknown Source)
    12/06/28 12:21:42      at com.ejb.client.EntryClient.getEntryList(EntryClient.java:145)
    12/06/28 12:21:42      at EntryServ.find(EntryServ.java:8613)
    12/06/28 12:21:42      at EntryServ.doGet(EntryServ.java:439)
    12/06/28 12:21:42      at EntryServ.doPost(EntryServ.java:280)
    12/06/28 12:21:42      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    12/06/28 12:21:42      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    12/06/28 12:21:42      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    12/06/28 12:21:42      at LogFilter.doFilter(LogFilter.java:57)
    12/06/28 12:21:42      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:644)
    12/06/28 12:21:42      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
    12/06/28 12:21:42      at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
    12/06/28 12:21:42      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
    12/06/28 12:21:42      at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
    12/06/28 12:21:42      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
    12/06/28 12:21:42      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
    12/06/28 12:21:42      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    12/06/28 12:21:42      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    12/06/28 12:21:42      at java.lang.Thread.run(Unknown Source)
    Single user means a single user logged-In,Multi user means 10-20 users logged in via apache jmeter for testing performance..
    Let me know if anthing else required
    Edited by: user9052593 on Jun 28, 2012 12:12 AM

  • GetUserPrincipalName() and mixing between stateful and stateless

    I am using VPD, BC4J and the Struts version included in JDEV 9.0.3 final version.
    When I am calling
    String userName = getUserPrincipalName();
    from ApplicationModuleImpl it works fine as long as I am using stateful for all BC4J viewobjects, but when I am mixing between a stateful and stateless application module, getUserPrincipalName() will return the previous users principal.
    An Example that will cause this problem:
    User 1: Goes to a web page using a stateful AM
    User 1: Goes to a web page using a stateless AM
    User 2: Goes to a web page using a stateful AM
    when user 2 goes to a stateful page he will retrieve
    user 1's principal.
    My questions are:
    1) Does getUserPrincipalName() only work under stateful?
    2) Does a struts application using stateful application module lose stateful state after calling a stateless application module?

    Ahhh forgot to add something...
    if you want to keep your existing exception hirarchy (ABCException extends RemoteException).
    then make sure that in your statefull session bean the order of the catch block is first the catch(ABCException) and then the remote exception.
    If the catch block for remote exception comes first, then the ABCException will be sent to that block itself because ABCException is a sub class of remote exception.
    However, IMHO, business exceptions should not extend the remote exception... as the RemoteException is used to report technical errors and not business errors.
    hope this helps ....
    regards,
    Abhishek.

  • Difference between stateful and stateless session beans

    can any body explain simply what is the difference between stateful and stateless session beans? also in what kind of situations we can use these.

    Hi
    This is the classificatio os Session Bean.
    (1) Statfull
    (2) Stateless
    Stateful means u will persists the state of the object.
    USESE:
    In a Banking system u can use the statful session just for maintaing the
    state.
    (2) STATELESS: that's mean u do't want to persists any state of the object. that's mean a single Request is coming ,do the desire and give the output.
    EX: A Credit Card System is the Example of Stateless.
    May it will helpfull to understands u. if any need write here
    saM

  • Stateful or stateless BSP application

    Hi
    I have a very complex application developed using stateful BSP.but there is a limitation to the stateful bsp that it will allow maximum 1000 users but my application can be accessed by more than 1000 users.
    So i am planning to change to stateless and i just want to know how feasible it is and how complex it is convert from stateful to stateless and what are the different ways to do that
    please let me know the answers ASAP as it is very urgent
    Points will be awarded for sure...
    Thanks
    Bala

    Refer this link, it will help you:
    <a href="http://help.sap.com/saphelp_nw70/helpdata/en/88/9dc53a87728677e10000000a11405a/frameset.htm">Session Handling</a>
    Raja T

  • 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

    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.

  • Stateful or stateless

    Hello,
    I have to develop a BSP application which will post invoice and there are only 5 possible users for this application. Which approach is better stateful or stateless???
    Thank you
    Thilothama

    Hi,
    As long as you do proper state management (see also /people/eddy.declercq/blog/2005/11/15/enemy-of-the-state) , you can choose either of them.
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • What is stateful and stateless message processing

    What is stateful and stateless message processing ?
    When it is used ?

    Hi
    Before going to Statefull or Stateless...u have to know about java and EBJ and what is session as well.
    Basically we are using 2 S in EBJ.It is nothing but persistance of data.
    Statefull: It means data are persists in multiple sessions.
    Stateless: It means data are persists in single session.
    in simple terms
    if you use BPM in your integration scenario then it is stateful.
    without BPM can be considered as stateless.
    Business Process Management provides SAP Exchange Infrastructure with functions for stateful message processing: The status of an integration process is persisted on the Integration Server. This means that you can specify how long an integration process must wait for further messages to arrive, for example. Furthermore, this enables you to process messages within an integration process further still; for example, you can collect certain messages and then send them in a particular order.
    This basically means SAP XI as a EAI tool without the BPM provides stateless message. this means that one message coming in SAP is not dependtent on another message.
    BPM in SAP XI is used to make messages stateful and this allows us to do functionalities like collecting message , splitting message, waiting for a message etc.
    Refer
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c656a9d-0901-0010-bcaf-fed14210c991#q-16
    http://help.sap.com/saphelp_nw04s/helpdata/en/93/33b504f33cb9468bf35f8fbda11294/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c656a9d-0901-0010-bcaf-fed14210c991
    thanks
    Swarup

  • Stateful vs. stateless session bean

    Hi,
    I am following the pattern of accessing entity beans with a session bean wrapper. I am just wondering if it's more efficient to make it a stateful session bean by keeping references to the home interfaces or make it stateless and do a lookup every time the session bean is created/activated?
    I suppose the number of entity beans I want to access might make a difference. If so, is there a rough number when one way becomes better than the other?
    Thanks for any help in advance.
    Jeff

    - It is far better to use a stateless session bean when implementing the session-facade pattern.
    - Keeping a home interface on the object won't make him stateful.
    - with the stateless beans, you do not decide when they're created. The container does.
    - The number of entity beans is not so important. The only thing important is to have a remote methode in your stateless(es) for each atomic transaction ("atomic" meaning here "you cannot cut").
    /Stephane

  • BC4J am - stateful vs. stateless - reality check.

    Hi,
    Suppose we have an web application that uses a BC4J AM instance during one single HTTP request and releases it just before the HTTP request is finished. Why would we want to bother doing a stateful release of the AM if we don't need db transaction state between HTTP requests? Can someone plz. come up with a couple of examples where stateful release would make sense?
    Appreciate it!
    -J.

    The Stateful mode for the AM pool is to manage application state, not transactional state.
    Typically web apps are used with optimistic locking mode and use the stateful AM checkin because they have application functionality that spans multiple web pages. For example, creating a purchase order might involve many web requests as the end-user adds line after line of expense-report lines.
    Using Stateful AM checking, you don't need to post or commit this pending application information to the database on each request. Your application just adds new lines in various VO's and the AM state management makes sure that your pending application state is there again on your next request.
    When you are done, you commit and all of the pending changes are done in the database.
    If you have no pending application state between requests, then use Stateless mode.
    However, if you are using stateless mode and committing partially completed application data on each request just because you want to use stateless mode, then you should consider using Stateful checkin mode instead since it still scales like a stateless web application, but can greatly simplify the task of programming your application because you program your application as if it were a stateful application.

  • Stateful and stateless firewall

    ASA5505 has a feature of "Stateless Active/standby" HA? What is the meant of stateless? And what is the meant of "stateful firewall". Thanks

    Hi Eric
    To answer the 2nd part of your question.
    A stateful firewall keeps track of the "state" of connections based on source/destination IP, source/destination port and connections flags. It can really only keep state for TCP connections because TCP uses flags in the packet headers. eg
    When a client telnets to a server.
    Client address = 192.168.5.1
    Server address = 172.16.5.2
    The client picks a random port eg 33212 and sends a packet to the server
    source IP = 192.168.5.1
    source port = 33212
    destination IP = 172.16.5.2
    destination port = 23 ( 23 is telnet port )
    TCP Flag = SYN
    Server responds
    source IP = 172.16.5.1
    source port = 23
    destination IP = 192.168.5.1
    destination port = 33212
    TCP FLAG = SYN/ACK
    Client responds
    Same as original client packet except
    TCP FLAG = ACK
    The above is called the TCP 3 way handshake.
    Now lets say there is a stateful firewall in between the client and the server.
    When the firewall sees the initial packet from the client it records all the info above.
    When the server responds the firewall looks up it's state table to see if it has a matching entry for the connection and finds it does. What's more because the firewall expects to see a SYN/ACK from the server because it recorded a SYN from the client. So the packet is allowed.
    Now lets say the client hasn't sent an intital packet and the server sent a packet with the same info as above. The TCP FLAGS are SYN/ACK but the firewall has no record of a SYN packet sent from the client. So the packet is dropped.
    In essence this is how stateful firewalls work . They keep track of each connection and allow the traffic to flow through only if there are corresponding entries in it's state table.
    For non-TCP protocols eg UDP there are no flags so the stateful firewall sets a timer ie. if it sees a DNS query go out it records the IP source/destination and the Port source/destination. If within a certain amount of time a packet is received back with the same IP'S and port number, although obviously the source and destination are flipped, the packet is allowed through.
    Hope this makes sense
    Jon

  • Help me in Stateless & Stateful Bean

    hi,
    I'm trying to understand to difference between the stateless and stateful bean. I had created an simple application to test it. But both the beans seems to work in the same way. Could some one explain me with an example the difference between the stateful and stateless bean ...
    I'm using J2EE Reference Implementation and Deploytool .
    Please help me .. Urgent ....
    Cheers !!!
    Prabs

    Thanks!!
    The State Session Bean tries to hold data , even after the client has finished execution. Moreover, the ejbCreate() get fired only once and not for different client.
    Is there anything that I should do to make it stateless.
    this is my code
    Session Bean
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import java.util.*;
    public class cartEJB implements SessionBean {
         private Map m;
         public cartEJB() { }
         public void ejbCreate() {
         m = new HashMap();
         System.out.println("ejbCreate()");
         public void ejbActivate() { }
         public void ejbPassivate() { }
         public void ejbRemove() { }     
         public void setSessionContext(SessionContext sc) { }
         public void addCart(String product, String price) {
         System.out.println("Its here Man 1");
         m.put(product, price);
         public void showCart() {
              System.out.println("Its here Man 2");
              Set s = m.entrySet();
              Iterator it = s.iterator();
              while(it.hasNext()) {
                   System.out.println(it.next());
    REMOTE
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface cart extends EJBObject {
         public void addCart(String product , String price) throws RemoteException;
         public void showCart() throws RemoteException;
    HOME
    import javax.ejb.EJBHome;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    public interface cartHome extends EJBHome {
         public cart create() throws CreateException, RemoteException;
    client application is an web based application ..
    Client code. ... (jsp:useBean)
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import javax.servlet.http.*;
    public class cartJSP implements HttpSessionBindingListener{
         String Product = new String();
         String Price = new String();
         HttpSession session;
         public cartJSP() {
         public void setProduct(String p){
              this.Product = p;
         public void setPrice(String price) {
              this.Price=price;
         public String getPrice() {
              return Price;
         public String getProduct() {
              return Product;
         public void addIt(String product , String price ) {
         try {
              System.out.println("Comes here");
              Context ic = new InitialContext();
              Object objref = (Object)ic.lookup("ejb/cartJNDI");
              cartHome home = (cartHome)PortableRemoteObject.narrow(objref, cartHome.class);
              cart remote = home.create();          
              remote.addCart(product, price);
              System.out.println("Comes here");
              remote.showCart();     
         catch(Exception e) {
              e.printStackTrace();
         public void showIt() {
         try {
              Context ic = new InitialContext();
              Object objref = (Object)ic.lookup("ejb/cartJNDI");
              cartHome home = (cartHome)PortableRemoteObject.narrow(objref, cartHome.class);
              cart remote = home.create();
              remote.showCart();          
              System.out.println("Comes here 1");
         catch(Exception e) {
              e.printStackTrace();
         public void valueBound(HttpSessionBindingEvent e) {
              session = e.getSession();
              session.setMaxInactiveInterval(60);
              System.out.println("Value Bound");
         public void valueUnbound(HttpSessionBindingEvent e) {
              System.out.println("Value UnBound");
    I'm using J2EE RI 1.3 and I'm deploying components using deploytool.
    Please help me,
    Check the code is wrong or is it a bug in the EJB container.
    regards
    prabu.

  • How do I set Stateful/Stateless behavior  in 9.0.5

    Good afternoon,
    In JDeveloper 9.0.3 I could set my root application module definition to stateful or stateless. How do I do that in JDeveloper 9.0.5?
    Thank you

    Only stateful release mode is supported in the preview.
    For production, we'll address bug#3045336 which will add back the stateless option.

  • Jcom vb-ejb(both stateless and stateful)'s problem

    I try the jcom sample on wls7.0sp4,it's ok.(the sample used entityBean)
    then,I try the session bean(both stateless and stateful),some problem occur :
    <2003/10/29 17:31:54:JST> <Error> <COM> <210000> <IOXIDResolver opNum 5 invoked.
    This method is not implemented.>
    <2003/10/29 17:31:55:JST> <Error> <COM> <210000> <IOXIDResolver opNum 5 invoked.
    This method is not implemented.>
    <2003/10/29 17:31:55:JST> <Error> <COM> <210000> <Export of object: examples.ejb
    [email protected] barred>
    the client vb source :
    Set objTemp = GetObject("examplesServer:jndi:ejb20-statefulSession-TraderHome")
    //the statement is wrong!!
    Set mobjHome = objNarrow.narrowobjTemp, "examples.ejb20.basic.statelessSession.TraderHome")
    can anyone help me?
    thks!
    p.s: the jndi name is correct.

    A deployed bean can not be both stateful and stateless. You must specify the session-type in the deployment descriptor. The reason that deployed beans must be either stateful or stateless is that the ejb container must know how to handle them. Stateful and stateless beans have very different life cycles as I'm sure HeadFirstEJB pointed out.
    What HeadFirstEJB might have been trying to say is that if you have a no-arg create along with other create methods, you may be able to deploy the bean as stateless in one environment and stateful in another. I can't think of any reason you might want to do this but I suppose there might be some valid reasons out there.

Maybe you are looking for

  • Data Recovery After Hard Drive Failure!

    Ok, basically, I've got a 2 1/2 year old iBook G4 with a bombed hard drive, and unfortunately, the last time I backed up was around 3 months ago. Here's what happened right before the crash: some applications like Widgets and Safari were acting fluky

  • Connect 3000 to an old TV

    I recently tried to hook up my laptop to an old Panasonic TV. I had everything going good. I had my S-Vid cable going to an RF modulator. Then had a coaxial going from the modulator to the tv. yeah, its that old. On the TV, all that showed was my des

  • Creating new company in sap b1 8.8

    Hi While creating new company in SAP-B1 8.8, it's giving me the following information. "Company was not added to read-only DB user. Read-only DB user must be updated manually" I had also given the SITE password and created  the new company successful

  • Database recovery from the server backup - 10g Oracle with Linux

    My server OS is Linux and nightly we are taking a whole logical volumes backup as it is and databses are not shutdown. so i would like to know how much worth keeping this copy in recovery purposes as it is taking few hours to copy all daily. If some

  • Stucked in error

    Hi experts, workflow is stucked in error.what i need to do here.can i strart the workflow after the error.if yes how to do this... please help me on this..