This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
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

EJB questions

 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.Which of the following statements accurately describe the J2EE architecture?

A. Web components provide presentation logic that works well with anonymous clients over the
Internet.

B. EJBs provide business logic within the context of transactions and persistence.

C. Web components access EJBs through the same APIs as application clients.

D. Application servers provide the infrastructure for the J2EE architecture.

2.Which of the following are TRUE regarding BMP Entity beans?

A. Persistent fields can be declared private.

B. The ejbFindByPrimaryKey() method returns void.

C. Finder methods are implemented at deployment time.

D. A record should be inserted into the database during ejbCreate().
3.A stateful Session bean is being passivated by its container. Assuming all fields are
non-transient, which of the following values will still exist following passivation?

A. null.

B. A JDBC Connection.

C. An Entity bean.

D. A SessionContext.

E. A UserTransaction.
 
Debanjana Dasgupta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My answers
1. B,C,D
2. A,D
3. B,C,D,E
I think these questions are from IBM 483 Sample test, So I knew the no. of choices to select.
Thanks
Debanjana
 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your answers. I can not understand some answer yet, please help to understand, thanks
1.Which of the following statements accurately describe the J2EE architecture?
I think answer A is correct(A. Web components provide presentation logic that works well with anonymous clients ), Web components, such as JSP, can play as presentation.

3.A stateful Session bean is being passivated by its container. Assuming all fields are non-transient, which of the following values will still exist following passivation?
C. An Entity bean.
what does it mean, instance or reference to object?
 
Eduard Manas
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I agree with Debanjana to questions 1 and 2.
Answer A to question 1 is tricky (very tricky). I think is false because by default EJB is meant to be secure and likes to keep track of users. In other words, J2EE applications like to know who is doing what and checking whether they have privileges. In other words 99.5% of the time you will have authenticated users using J2EE applications. However, it must be noted that you can also have anonymous clients using EJBs configured without security context, but based on my experience, this is very rare. To sum up, I think A is false because it does not describe ACCURATELY a J2EE architecture.
Regarding to question 3, this is one of those stupid questions I dread to have in the real exam. Who really cares what you have got in the bean after passivation? Nobody!, as the java object will be destroyed anyway.
If the question was 'what object references can you have after a call to ejbPassivate?', then the answer would be ACDE.
In fact, you cannot have a JDBC connection object while the session bean is passivated, as this will throw a serialization exception (it doesn't implements Serializable interface). To avoid this the object reference should be set to null in ejbPassivate.
To sum up, I don't know the answer because this question does not make any sense to me. Could anyone explain it?
Thanks
Eduard
 
Eduard Manas
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, do you know the URL to that IBM test?
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic