[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Mustafa Garhi wrote:How do you get around 'multiple setters for my count problem' using stateful without using HttpSession etc.
Mustafa Garhi wrote:
And what do you mean by getting back to my bean - Does it mean trying to use the same bean in some other servlet say?
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Mustafa Garhi wrote:JB Considering the code again :
// part 1
MyStateLessEJB statelessEjb = getStatelessEJBInstance();
statelessEjb.setCount(10); // line 1
statelessEjb.getCount(); // line 2
Also assume there is no one else using this stateless.
Q. Is it possible that statelessEjb at line 1 and statelessEjb at line 2 are two different beans if i have a pool of say 10 for this stateless?
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Usually you don't get direct access to an ejb instance because that's handled by the ejb container. If you use something likeMyStateLessEJB statelessEjb = getStatelessEJBInstance();
It's possible that the methods calls in lines 1, 2 are performed by different bean instances from the pool.Is it possible that statelessEjb at 1 and statelessEjb at 2 are two different beans from the pool?
SCJP 5 (98%) - SCBCD 5 (98%)
Mustafa Garhi wrote:I might have more doubts as i keep exploring EJBs so not marking this one resolved
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2