Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SFSB question

 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Palak Shah
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Think So! Other experts please confirm.
 
Ana Nava
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, beforeCompletion() is called irrespective of transaction is committed or rolledback. This gives last chance to rollback the transaction.

--Prashant
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If transaction is rolled back beforeCompletion() won;t be called.

sawan
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!