wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes doubts in mock exam questions. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "doubts in mock exam questions." Watch "doubts in mock exam questions." New topic
Author

doubts in mock exam questions.

Shanmugam Karthikeyan
Ranch Hand

Joined: Aug 02, 2002
Posts: 58
1. Select all combinations of transaction attributes that would make this scenario possible (without exceptions being thrown).

A. B-Supports, C-Required, D-Supports, E-Required, F-NotSupported
B. B-NotSupported, C-Required, D-Mandatory, E-RequiresNew, F-NotSupported
C. B-NotSupported, C-RequiresNew, D-Required, E-RequiresNew, F-Never
D. B-Never, C-Required, D-Required, E-Mandatory, F-Never
E. B-NotSupported, C-RequiresNew, D-Supports, E-RequiresNew, F-NotSupported
F. B-NotSupported, C-Mandatory, D-Supports, E-RequiresNew, F-NotSupported


ans : b,e

My doubt in this question is that how come option B is right.

Below is my justification for option B not to be a right choice.

Here is this case since method B has trans attribute as 'not supported',it will suspend the
transaction(A) comming from the Method A and executes the method B without a transaction.
After method B completes, it will resume the suspened transaction(A) and calls method C with that transaction.
Here since method C has the trans attribute as required, it will continue to make use of the resumed transaction(A)
rather than starting a new transaction(B).But the requirement is that method C should start a new transaction B.


Pls correct me if iam wrong.







2. Select all correct statements that will result in the removal of an entity object.

A. Invoking delete() on the entity bean�s home interface and providing the primary key in argument.
B. Invoking delete() on the entity bean�s component interface and providing the primary key in argument.
C. Invoking remove() on the entity bean�s home interface and providing the primary key in argument.
D. Removing another entity bean that is in a one-to-one or one-to-many container-managed relationship with the entity bean,
and the element (in ) is specified for the entity bean.


ans : c,d

Can any one explain me how option D is correct.


SCJP 1.4<br />SCWCD 1.4<br />SCBCD 1.3
Clifford Fernandes
Greenhorn

Joined: Jun 07, 2005
Posts: 8
Question 1)
B. B-NotSupported, C-Required, D-Mandatory, E-RequiresNew, F-NotSupported

Here "B" runs in an unspecified transaction context since its mentioned "not supported". C has an attribute "Required" so it will create a new transaction(TXN-A) since B was in a unspecified Txn context. Since attribute for D is mandatory. It will run in the callers txn i.e; (TXN-A). E requires a new txn so it will create a new txn (TXN-B). Fdoes not supporta txn so it will run in a unspecified txn context..

Question 2)

I am not very sure about this . could some experts throw some light on this..Also to add if a bean is removed then isnt it neccessary for cascade-delete tag be present in the DD for the other bean to be removed as well.???


sCJp 5.0 79%<br />sCwCd 1.4 94%<br />sCbCd 1.3 95%
Ugender Rekulampally
Ranch Hand

Joined: Nov 14, 2005
Posts: 130
Karthikeyan,

The first question's answers are wrong. the answers are given as B and E and I see those two choices throw Exceptions.
and I see all the 6 choices are bad so guess this is a poorly designed question.

for the second question, the two choices are correct since its a one-to-one or one-to-many relation ship.


Thanks,
Ugender
 
Consider Paul's rocket mass heater.
 
subject: doubts in mock exam questions.
 
Similar Threads
Transaction questions
doubt in ejb transaction
EJB Transaction
some confusion
Mock exam questions on MDB (2)