File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes SFSB question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "SFSB question" Watch "SFSB question" New topic
Author

SFSB question

sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
Hi ,
Is this method sequence correct for SFSB

1 bean is activated
2 afterBegin is called
3 business method is called
4 beforeCompletion is called
5 transaction is committed
6 afterCompletion is called


Sawan


Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
Palak Shah
Greenhorn

Joined: Jan 21, 2005
Posts: 18
I Think So! Other experts please confirm.


Palak Shah,<br />SCJP (85%), SCWCD (84%), SCBCD (95%).
Ana Nava
Greenhorn

Joined: May 25, 2004
Posts: 24
I would alter it a tiny bit for clarity sake .

1 bean in "ready state"
2 transaction begins
3 afterBegin is called
4 business method is called
5 beforeCompletion is called
6 transaction is committed or rolledback
7 afterCompletion is called
sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
Thanks for the replies. But still I am not very clear.

1 bean in "ready state"
2 transaction begins
3 afterBegin is called [I had this understanding that afterBegin is called after the business method call. Please confirm that afterBign call will be before business method.]
4 business method is called
5 beforeCompletion is called [This will be called only if the transaction will commit. Am I right?]
6 transaction is committed or rolledback
7 afterCompletion is called


sawan
Prashant Neginahal
Ranch Hand

Joined: Sep 14, 2002
Posts: 77
No, beforeCompletion() is called irrespective of transaction is committed or rolledback. This gives last chance to rollback the transaction.

--Prashant


Thanks, <br />Prashant<br />SCJP, SCBCD
sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
If transaction is rolled back beforeCompletion() won;t be called.

sawan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SFSB question
 
Similar Threads
Stateful Session beans Transaction Boundaries
How a Statefull Session Bean is tied to the Client
Mock Questions: transactions
Question for CMT Session Bean
How to do remote file i/o within EJB