• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Home methods in a bean class

 
julius hock
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A free mock exam question as below:
Which of the following statements about Home methods in a bean class is incorrect for Container Managed Persistence [choose 1]:
A: The method must not access relationships.
B. The throws clause of the method may include the java.rmi.RemoteException.
C. The method must not access the bean's persistence state.
D. The method cannot be declared static.
E. The throws clause may include any exceptions defined by your application.

The answer is B. Isnt the RemoteException is allowed to be thrown by home method?
Any help would be much appreciated.
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Julius,

I guess this choice 'B' is based on some assumptions. the question is saying home business methods so it has to be entity bean and already said it is a CMP.

and if you look at all the options, everything looks fine from a home business method point of view.

But here is important thing. if some entity beans are in relationships then those beans must be local to each other. So based on this, local home interfaces doesn't throw remote exception.


question should have given some more details like, the bean involves in a relationship or something that triggers that the bean has local home interface...


Hope this helps.

Thanks,

Ugender
[ October 13, 2006: Message edited by: Ugender Rekulampally ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic