aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes SCBCD Mock Questions, batch #3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "SCBCD Mock Questions, batch #3" Watch "SCBCD Mock Questions, batch #3" New topic
Author

SCBCD Mock Questions, batch #3

Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
More fodder, with new and enhanced disclaimers:
Disclaimers:
You WON'T get any questions on the real exam that say 'choose all that apply' - you will always know exactly how many answers are correct. I use 'choose all that apply' to make these questions harder, you know, to toughen you up a bit
When I say 'choose all that apply', there will ALWAYS be at least one correct answer.
The real exam uses several forms of 'drag and drop' which I'm kind of pseudo-emulating here; read the questions carefully, for instance some are one-to-many, some are not!
Finally, remember the real exam is NOT open-book
End of disclaimers, and on to the questions:

1. Which are directly invoked by the client? (Choose all that apply.)
a). ejbPassivate
b). business methods
c). setSessionContext
d). newInstance
e). create

2. Which is true about passivation for stateful session beans? (Choose all that apply.)
a). The container can passivate a stateful session bean regardless of the bean's state.
b). The client can passivate a session bean.
c). References to JNDI contexts are lost during passivation.
d). References to 'SessionContext' are preserved during passivation.
e). A passivated, stateful session bean instance will always be re-activated prior to removal.

3. (Note: The real exam has several types of 'drag and drop' questions, that I'm going to do a lame job of simulating with this question...)
Match the methods on the left with the interfaces in which those methods can be found, on the right. A match is correct if the method is either declared in, or inherited by, the interface. Note: There may be some many-to-one and one-to-many relationships in your answer.

4. Which statements about stateful and stateless session beans are true?
(Choose all that apply.)
a). Only stateful session beans support transactions.
b). Only stateful session beans can be passivated.
c). Only stateful session beans have a 'setSessionContext' method.
d). Both stateful and stateless session beans can support overloaded 'ejbCreate' methods.
e). Both stateful and stateless session beans can implement the 'javax.ejb.SessionSynchronization' interface.
f). Both stateful and stateless session beans can have instance variable state.

5. Which statements about a session bean class are true? (Choose all that apply.)
a). They can be marked 'final'
b). They can support overloaded constructors.
c). Their business methods can be 'private'.
d). Their business method names must start with "ejb".
e). Their 'ejbCreate' methods must not be declared as 'final'.

6. For this drag and drop type question, you can use each element only once. Which interface should be matched with which fact, so that all four matches are correct?

Have Fun !
-Bert
[ May 30, 2003: Message edited by: Bert Bates ]

Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Hung Tang
Ranch Hand

Joined: Feb 14, 2002
Posts: 148
1. b,e
2. c,d
3.
SessionSynchonization -> afterCompletion, afterBegin
SessionContext -> isCallerInRole, getRoleBackOnly, getUserTransaction
Sessionbean -> setSessionContext
UserTransaction -> ??? =)
4. a, b, f
5.
1 -> b
2 -> d
3 -> a
4 -> c

ill be happy to get 3/6 =)
Hung Tang
Ranch Hand

Joined: Feb 14, 2002
Posts: 148

5.
1 -> b
2 -> d
3 -> a
4 -> c

Oops, mistake:
5. e
6.
1 -> b
2 -> d
3 -> a
4 -> c
Dennis Shi
Greenhorn

Joined: Mar 22, 2003
Posts: 17
My answers:
1. b, e
2. d
3. a) --> 1)
b) --> 2)
c) --> 1)
d) --> 2)
e) --> 2)
f) --> 3)
4. b, f
5. e
6. 1) --> b)
2) --> d)
3) --> c)
4) --> a)
dennis
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Regarding constructors, I understand that there is nothing wrong in having overloded constrcutors as long as there is a no args constructor.
Good work,Dennis Shi .


Groovy
Sundeep Dhillon
Greenhorn

Joined: Jan 13, 2004
Posts: 2
1 b e
2 d
3 a 1
b 2
c 1
d 2
e 2
f 3
4 b f
5 e
6 1 b
2 d
3 c
4 a
agree completely with dennis
Goan Balchao
Ranch Hand

Joined: Mar 25, 2002
Posts: 93
Hi,
I don't seem to agree with the answer for question 4. Shouldn't it be b,f.
A statless Session Bean can have instance variable state - albeit just across the single method call. There is nothing in the spec that says otherwise. I know it dosen't make much sense to have instance vraiables in Statless session beans, but technically that is possible.
Anyone agree with me ?


Hemant Kamat<br />SCJP2<br />SCWCD<br />SCBCD<br />SCEA-I
Sundeep Dhillon
Greenhorn

Joined: Jan 13, 2004
Posts: 2
hi Akasmat,
agree with u completely which is why i have gone for b and f for question 4
Udai
Greenhorn

Joined: Dec 15, 2003
Posts: 4
My Answers:
1. b,e
2. d,e
3.
a). afterCompletion ----------> SessionSynchronization
b). getUserTransaction----------> SessionContext
c). afterBegin ---------> SessionSynchronization
d). isCallerInRole----------> SessionContext
e). getRollBackOnly ----------> SessionContext
f). setSessionContext ----------> SessionBean

4. b,f
5. e

6.
1) remote component----->b. extends 'javax.ejb.EJBObject'
2) remote home--->d.can be used to retrieve an EJBObject reference.
3) local component--->c. methods must NOT throw 'java.rmi.RemoteException'
4) local home--------->a. does not have a getHomeHandle() method

-Rishi


-----------------------------------<br />Never argue with idiots. They drag you down to their level and then beat you with experience !!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SCBCD Mock Questions, batch #3