I am new to EJB and recently started working on EJB (3.0). I have been using Java for 6 years, but have not worked with EJB before. I am at least stunned by the complexity of the entire EJB business. I do not understand where I can practically apply some of the concepts.
One question that comes to my mind after understanding a session without a bean state: Can you not always replace a session without a bean with a common instance of the class without local members (which makes it inactive)? I read that instance merging is done for a session without beans state. If there is no state, can't you just use one instance?
I am deploying my samples in OpenEJB and in one place where I had to use a session without a bean state was to interact with EntityManager. I'm not sure if I can handle the EntityManager in an arbitrary class. In addition to this, the question of what is trying to solve the problem of an idle bean is still puzzled.
source
share