• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Some Questions from Mock Exams

 
Vijaya laxmi
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can saome one help me out with these Questions

1.An entity bean instance with container-managed persistence can be passivated when the bean instance is associated with a transaction.True or false.

2.The Bean Provider must create a primary key class for an entity bean with container-managed persistence.True or False.

3.When a stateful session bean is passivated then any reference to a resource manager connection factory will NOT be saved.True or false.

4. An enterprise bean with container-managed transaction demarcation tries to access the javax.ejb.UserTransaction interface using JNDI.Exception is thrown ,i.e which exception is thrown.

thanx a lot in advance.

Vijaya
 
Vijaya laxmi
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My thoughts about the answers are

1A....
2A.According to spec it says that Bean provider must create a primary key class.
With CMT is it not possible that Container creates a PKclass when we define the
Primary key field,just as it implements Home and Component classes for us.

3A.I think it is true .

4A.Will it throw IllegalStateException .

Please tell me whether these answers are right for my Questions or not.I am not sure of these.
 
Dan T
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. The spec it says that ejbPassivate must be called in a unspecified transaction. For entity and session beans.

3. Actually, ejbPassivate will save the resource manager connection factory becuase it is one of the things on the list which can be passivated.
 
Severin Stoeckli
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2.The Bean Provider must create a primary key class for an entity bean with container-managed persistence.True or False.


False, it can map ho a single field:


Spec, 10.8:

There are two ways to specify a primary key class for an entity bean with container-managed persistence:
� Primary key that maps to a single field in the entity bean class.
� Primary key that maps to multiple fields in the entity bean class.

The second method is necessary for implementing compound keys, and the first method is convenient for
single-field keys. Without the first method, simple types such as String would have to be wrapped in a
user-defined class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic