stateless session bean


EJB programming & troubleshooting: stateless session bean

  1. stateless session bean (3 messages)

    hi everyone,

    can we write the database connection code in the stateless session bean................
    i mean i just need to connect to the database and display the records on the database..................


    Threaded Messages (3)

  2. stateless session bean[ Go to top ]

    Hi Mahadevan, yes you can as long as you keep in mind that a stateless session bean cannot pertain any state across multiple method invocations. Just get the connection, read the data, close the connection and return the data to the caller.
  3. stateless session bean[ Go to top ]

    Hi Mikael,

    thanks for you reply.
    mikael, i heard that session beans can handel only one client , what does it mean.
    say for example, if i create an application and deploy it on the server and a client A wants to read the data and at the same time Client B wants to read the data will it not work for Client B.
    I am confused.....

    thanks again.

  4. stateless session bean[ Go to top ]


    Each EJB object, or instance, can only have one client. Thus, client A and client B will each call a different EJB object. Unlike servlets, EJB objects are not thread aware.

    Hope this helps!