Thank you all. I am reading more about this. I have done some reading before asking the question, as I am not expecting the work to be done for me. However, just like any new EJB user, the concept was not fully comprehended and there was some confusion.
I have used JPA before, but not with EJB (with spring container). I realized later that a statefull session is attached and specific to the session. My requirements will fit with a stateless bean or an entity (but I don't need a db), so it will be a stateless. To make things clearer, I will explain quickly what I am doing. I need to simulate the interaction for the some units in an organization (Emergency response). The units (initially, police , ambulance, fire fighters ), responds and acknowledge and communicate the info they receive using messaging. I thought EJB and JMS will fit especially with the distributed nature of the system (servers represents federates, where units can be borrowed ). I was looking to create a pool of Unit (ie, police officers ) using stateless beans, where the state is preserved, but they are not attached to any session, and their behavior is independent from the request (ie, request to generate a report). My next question would be, is to find it it's possible to get a stateless bean to receive JMS messages and act accordingly ! I am still prototyping, any advice will be appreciated. On Sun, Dec 6, 2009 at 12:04 AM, Ravindranath Akila <[email protected]> wrote: > Andy is right Mansour please do some reading on this. EJB 3.x has Stateful > Session Beans, Stateless Session Beans and Entities (NOT Entity Beans). The > Sun tutorial is one of the most simple tutorials you can find on this. > Entities on the other hand, will be explained in any tutorial of JPA. So to > find out about Entities, read a JPA tutorial. This is a very good JPA > tutorial http://schuchert.wikispaces.com/JPA+Tutorial+1+-+Getting+Started. > > Yes the same Stateful Beans cannot be retrieved across multiple "web" > requests unless you store the bean with use of a framework or HTTP Session. > Stateful really indicates "not shared", and "not discarded as long as > referenced". > > > On Thu, Dec 3, 2009 at 1:44 AM, Mansour Al Akeel > <[email protected]>wrote: > >> I am looking to maintain an object pool, that will be available to >> server a request at anytime. If I am not wrong, statfull bean will not >> work as it's ot server on request. I need to maintain the info between >> these requests. I have to use Entity bean. Is this correct ? >> >
