• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Some Questions from Mock Exams

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic