Claire Simpson

Greenhorn
+ Follow
since Dec 04, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Claire Simpson

Hello Gemini

I was averaging in the 80%'s on SoftSCBD, a few percent less in EJBPlus which I think was harder. I got just under 80% in the HFE Final exam.

Hope this helps.

Good luck!
18 years ago
Wow! I didn't expect that! At 6 months pregnant my brain should be shrinking!

For preparation, I read HFE twice which was a good, entertaining introduction. I then bought EJBPlus and SoftSCBCD exam simulators which were invaluable. A good deal of the questions they provide are on a very similar vein to the real thing. I occassionally referred to the spec but don't think my attention span would have lasted to read the whole thing!

The questions on the exam were more straight forward than I had expected and I had plenty of time to double check each answer.

Thanks to all of the HFE contributors and the forum participants who have been very helpful.

Claire
18 years ago
Thanks for clearing that one up Ravi.
Superb answer. Thanks Ravi!
Thanks for the answers guys. It all makes sense now!

BTW the client tx is not rolled back because its tx is suspended when it calls the Bean A method with a tx attribute Not Supported. So the client's tx is completely independent from what happens subsequently.
Hello

I have just completed a mock exam questions as follows

Given:
Bean A with transaction attributes of "NotSupported" for all its methods.
Bean B with transaction attributes of "Mandatory" for all its methods.
A client having a transaction context calls a method on bean A, which in turns calls a method on Bean B.
Assuming all invokations are local, which of the following statements is correct?

Select 1 correct option.
a The client's transaction will be marked for roll back.


b The client will get a javax.ejb.EJBException but it can continue with the same transaction.


c The client will get a javax.ejb.TransactionRolledbackLocalException


d The bean B instance will be discarded.


e None of the above.

The answer given is B which I agree is correct. Here is the explanation

Since bean B method's transaction attribute is Mandatory, it means that its caller must have a transaction context. In this case, its caller is bean A's method. Since its transaction attribute is NotSupported, it does not execute within a transaction context. Therefore, when it calls B's method, it will get a javax.ejb.TransactionRequiredLocalException. Since this exception extends from EJBException, it is a system exception. This means that bean A method encounters a system exception and thus the bean A instance will be discarded. There is no impact on bean B instance.
Further, since A's method's transaction attribute is NotSupported, the client's transaction was suspended during the execution of the method. So even though A's method encounters a system exception, the client's transaction will not be marked for a rollback.
A system exception in a bean's method translates to an EJBException for a local client and a RemoteException for a remote client. Therefore only option 2 is correct.

What I don't understand is why is bean B not discarded??? It throws a System exception in TransactionRequiredLocalException so why isn't it discarded???

Thanks in anticipation
Hello

Could someone please clarify how to know when to narrow an object. I understand that we need to narrow remote stubs but how do we tell what a remote stub is. For example, in mock exams I have seen that we need to narrow the result of
handle.getEJBObject() which return EJBObject
but just need a normal Java cast for EJBContext.getEJBObject()

How are you supposed to tell the difference??

Here's a list of what I do know.
Must narrow:
jndi lookup of EJBHome
Single entities from Finder method Collection results
getEJBObject from Handle class
getEJBHome from Home Handle

Need not narrow:
EJBContext.getEJBObject
Single Finder method results
EJBObject creation in create methods

What happens with:
EJBContext.getEJBHome
EJBObject.getEJBHome

Thanks in advance!
Hello

I am very confused as to how to answer the question which types of EJB can survive a Container Crash. There are contradictions in opinions even within this forum. Does anyone know what answer will be seen as correct on the exam?

So far Entity Bean seems like a certainty to survuve and Stateful Session Bean not to survive. But I've seen conflicting opinions on whether Stateless Session Beans or MDBs survive. Help!