Announcement Announcement Module
No announcement yet.
Simple problem - executing methods after a successful commit Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple problem - executing methods after a successful commit


    I am wondering how to the following:

    I have transactionalized method A. I would like to know whether or not A has successfully committed. If it has committed successfully, I'd want to execute method B. So how does one go about doing this when using Spring transactions?

    I am using proxybeans and transactionManager etc... I am sure there is quite a simple answer to this since its a simple thing to do, but I am having a hard time finding the answer...

    Any help would be appreciated.

  • #2
    To answer my own question, the solution here is transactionInterceptors (AOP). I would need an after-returning advice on the method in question, and pass the relevant parameters to that advice as well as set the precedence of the advice to something higher than the transaction advice. This will ensure that my after-returning advice will be executed after the transaction commit.

    GG thanks everyone