• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Questions

 
Arthur Orange
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following are taken from Muhammad Ashikuzzaman's SCBCDExam Notes. Wish he would include the answers too.

Can someone please provide the answers to the following. Mine are at bottom

SQ1. Which are true about session beans?
A. A client can pass a remote home object reference to another application.
B. The javax.ejb.EJBMetaData interface is intended to allow application assembly
tools to discover information about the session bean, and to allow loose
client/server binding and client-side scripting.
C. The javax.ejb.EJBLocalHome interface defines the method create() which returns
javax.ejb.EJBLocalObject.
D. The javax.ejb.EJBLocalHome interface defines the method remove(Object primaryKey)
which returns null.

Answers:
a, b , c

SQ3. Which are true about session beans? (Choose all that apply)
A. An attempt to remove a session object while the object is in a transaction will
cause the container to throw the IllegalStateException to the client.
B. A session bean class must not implement the session bean's component interface.
C. A session bean class must not implement the ejbCreate() method.
D. The business methods of a session bean must not be declared as final or static.
E. The remote interface methods must not expose the managed collection classes
that are used for CMP entity beans as arguments or results.

Answers:
a, d

SQ4. Given a CMP entity bean, which of the following statements are correct?
(Choose all that apply)
A. All the exceptions defined in the throws clause of the method of the remote interface
must be defined in the throws clause of the matching method of the enterprise Bean class.
B. The ejbSelect<METHOD>(...) must not be declared as static or abstract.
C. The ejbHome<METHOD>(...) can be declared as final.
D. The return value type of a business method of an entity bean class could be of MyClass defined
as follows:
public class MyClass {
public int result;
public int getResult() { return result; }
public void setResult(int result) { this.result = result; }
}
E. The throws clause of an ejbPostCreate<METHOD>(...) may define
arbitrary application specific exceptions including javax.ejb.CreateException.
F. The bean provider must always define a query for each finder method in the deployment descriptor.

Answers:
d,e,f
 
Vagner Freitas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arthur,

In my understanding, these are the answers:

SQ1 - A,B
C is incorrect because EJBLocalHome interface do not define any create method.
D is incorrect because the remove(Object primaryKey) is not about session beans.

SQ3 - A, D

SQ4 - C
D is incorrect because the return type of a business method must be RMI compatible, in other words MyClass must implement Serializable interface.
F is incorrect because the bean provider do not have define a query for findByPrimaryKey method.

Does someone have others answers?
Thanks.

Vagner
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion-
SQ1 - a,b,c
SQ3 - a,b,d
SQ4 - d,e,f

Regards,
Leena
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic