Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

queries

 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have few queries.

1. Mock exam question - Which of the following statement is incorrect about entity bean's remote component interface (select the best answer)

Ans given: It can be used to obtain handle to the entity bean's remote home interface
My ans: It can be used to obtain handle to the entity bean instance
[I thought getting a handle to bean is not possible. All you can get is Handle from the getHandle() method to the EJBObject. But in the former case, you can atleast get the EJBHome and then proceed to get its handle from EJBHome. I do not find either of them properly framed. What is your opinion?]

2. Which of the following are the responsibilities of a Bean Provider with respect to system exceptions (select the best answer) -

My Ans: If the enterprise bean cannot recover from an unchecked system exception then the Bean Provider is responsible for catching the unchecked exceptions and re-throwing it to the container as javax.ejb.EJBException

Exam Ans: If the enterprise bean cannot recover from a checked system exception then the Bean Provider is responsible for catching the checked exceptions and re-throwing it to the container as java.ejb.EJBException
[My answer is right. Am I missing something here?]

3. The statement is true or false: An entity bean instance with container-managed persistence can be passivated when the bean instance is associated with a transaction: True
Is it true?

Regards,
Leena
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more -

Q. Which of the following EJB roles is expected to be an application domain expert (select the best answer):
A. Bean Provider
B. Application Assembler

I chose B. The answer is A. Your views?
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think 'A' is right. Bean Provider is the one, who write the Business Logic, so he/she must have strong domain knowledge than the Application Assembler.

[ March 03, 2005: Message edited by: -Sanju Thomas- ]
[ March 03, 2005: Message edited by: -Sanju Thomas- ]
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
---------------------------------------------------------------------------
2. Which of the following are the responsibilities of a Bean Provider with respect to system exceptions (select the best answer) -

My Ans: If the enterprise bean cannot recover from an unchecked system exception then the Bean Provider is responsible for catching the unchecked exceptions and re-throwing it to the container as javax.ejb.EJBException

Exam Ans: If the enterprise bean cannot recover from a checked system exception then the Bean Provider is responsible for catching the checked exceptions and re-throwing it to the container as java.ejb.EJBException
[My answer is right. Am I missing something here?]
----------------------------------------------------------------------------

I dont think that you can catch an unchecked exception!.
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
--------------------------------------------------------------------------
3. The statement is true or false: An entity bean instance with container-managed persistence can be passivated when the bean instance is associated with a transaction: True
Is it true?
--------------------------------------------------------------------------

This is true in EntiryBean's case, But false for Stateful SessionBean.
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by -Sanju Thomas-:
I dont think that you can catch an unchecked exception!.



Oh sorry! My mistake. I thought of a scenario when we catch SQLExceptions and re-throw them as EJBException. And I thought SQLExceptions as unchecked which was wrong!

Thank you. You got me to think on it again.

Regards,
Leena
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by -Sanju Thomas-:
I think 'A' is right. Bean Provider is the one, who write the Business Logic, so he/she must have strong domain knowledge than the Application Assembler.



He does write the code but he might just provide one bean. The App Assembler might get two other ready-made beans and assemble all three together to make a complete 'application'. So she must be a 'application' domain expert.

I checked in HFEJB this morning and from on page 26 I think App Assember can be concluded as the answer.

Regards,
Leena
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by -Sanju Thomas-:
This is true in EntiryBean's case, But false for Stateful SessionBean.



Thank you Sanju.

Found this on page 169 of ejb spec.
The container can choose to passivate an entity bean instance within a transaction. To passivate an instance, the container first invokes the ejbStore method to allow the instance to prepare itself for the synchronization of the database state with the instance�s state, and then the container invokes the ejbPassivate method to return the instance to the pooled state.

Regards,
Leena
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Leena Diwan:


He does write the code but he might just provide one bean. The App Assembler might get two other ready-made beans and assemble all three together to make a complete 'application'. So she must be a 'application' domain expert.

Regards,
Leena



Yes,You are right.
 
The knights of nee want a shrubbery. And a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic