Miki<br /> <br />SCJP 1.4, SCBCD 1.3
I thought F is incorrect since afreCompletion() runs without transaction context
I think E should be correct, since the TX attribute is supports, so if the calling application runs in UTC, this session bean also runs in UTC so implicilty afterBegin() runs in UTC.
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
If there is no transaction then afterBegin() logically shouldn't be called. I am not sure what specs say about this.Other experts please comment.
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
When a new transaction begins, the afterBegin() method is then invoked to inform the stateful session bean of this fact. The afterBegin() method is therefore invoked with the transaction context, so database updates may be done in this method.
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
The afterBegin() method is therefore invoked with the transaction context
A session bean's afterBegin() and beforeCompletion() methods are always called with the same transaction context as the business methods executed between afterBegin() and beforeCompletion() methods
Miki<br /> <br />SCJP 1.4, SCBCD 1.3
The point is if the calling application is running in unspecified transaction context then is afterBegin() called?
Miki<br /> <br />SCJP 1.4, SCBCD 1.3
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
The afterBegin notification signals a session bean instance that a new transaction has begun.
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
Miki<br /> <br />SCJP 1.4, SCBCD 1.3
I will create as well later this week but since I have the exam tomorrow I don't have time now.
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
With Regards,<br /> Rajan<br />"Java Rocks"
All these methods are callback methods.You do not call them.Container calls them due to various events that occur
Originally posted by Shanel Jacob:
Hi, Page 309 of HFEJB states "The Container calls the bean's ejbActivate() method ... The bean runs ejbActivate() before it runs the business method that triggered the activation." So for a passivated session bean that implements SessionSynchronization interface, the order of events will be:
1) ejbActivate runs, followed by afterBegin, beforeCompletion and lastly, afterCompletion.
OR is ejbActivate the last one to run?
2) afterBegin runs, followed by beforeCompletion, afterCompletion and lastly ejbActivate.
Thank you.
With Regards,<br /> Rajan<br />"Java Rocks"
-ejbActivate()
-Business method() (because of a call to this the bean is activated)
-beforeCompletion()
-afterCompletion()
Originally posted by Shanel Jacob:
Thanks for the tip Rajan. I've not gotten that far in the book yet but I hope to cover them this weekend.
One point though, in the sequence you've listed, afterBegin() was left out.
From the book, it says that afterBegin() runs BEFORE the business method and transaction commits BEFORE afterCompletion().
So I will update the sequence you've given, do let me know if it makes any sense.
Sequence 1 - ejbActivate()
Sequence 2 - afterBegin()
Sequence 3 - Business method
Sequence 4 - beforeCompletion()
Sequence 5 - Commits transaction
Sequence 6 - afterCompletion()
With Regards,<br /> Rajan<br />"Java Rocks"
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|