Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

SFSB question

 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I Think So! Other experts please confirm.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If transaction is rolled back beforeCompletion() won;t be called.

sawan
 
reply
    Bookmark Topic Watch Topic
  • New Topic