Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

soft scbcd test questions?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(1) The statement is true or false:
In a session bean's setSessionContext(SessionContext) method the
component interface of the session bean can be obtained by calling
javax.ejb.SessionContext's getEJBObject() or getEJBLocalObject() method

Answer is FALSE. I think it should be TRUE


(2) The statement is true or false: Transaction attributes are specified at the ejb-jar file level i.e., they are applicable to all the enterprise beans in the same ejb-jar file

Answer - FALSE . why?

(3) A message-driven bean instance can not concurrently serve multiple clients.
if this is true then session / entity beans can serve clients concurrently?

Regards,
Yamini
 
Me
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yamini nadella:
(1) The statement is true or false:
In a session bean's setSessionContext(SessionContext) method the
component interface of the session bean can be obtained by calling
javax.ejb.SessionContext's getEJBObject() or getEJBLocalObject() method

Answer is FALSE. I think it should be TRUE


ONLY Bean thing you can do in set<Session/Entity>Context(...) method is
Use your <Session/Entity>Context -> to get a reference to your home
(HFEJB page 196)
So answer should be FALSE.

Originally posted by yamini nadella:
[QB(2) The statement is true or false: Transaction attributes are specified at the ejb-jar file level i.e., they are applicable to all the enterprise beans in the same ejb-jar file

Answer - FALSE . why?
[/QB]

Transaction attributes are described on per method basis. See following DD example


So you describe both ejb name and method name and trans-attributes are described on per method basis.
Hence the answer should be FALSE

Originally posted by yamini nadella:
[QB(3) A message-driven bean instance can not concurrently serve multiple clients.
if this is true then session / entity beans can serve clients concurrently?
[/QB]


A single Stateless session bean can handle multiple clients as long as only one client at a time is in the middle of a method. (HFEJB Page 103)

But clients never share the bean.

Entity beans, client share the home and may share the bean (HFJEB page 99)
 
Roger Yates
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to add to the previous answer to:

Originally posted by yamini nadella:
[QB(3) A message-driven bean instance can not concurrently serve multiple clients.
if this is true then session / entity beans can serve clients concurrently?
[/QB]


I'm currently running through the EJB 2.0 spec, and came across the following which may help with regards to the entity beans part of your questions.
The EJB 2.0 spec, page 119, just before section 9.7.1 states:
Multiple clients can access the same entity object concurrently. Transactions are used to isolate the clients' work from each other.


Cheers,
Roger
SCJP 1.2,1.4, studying for SCBCD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic