[jbossts-issues] [JBoss JIRA] (JBTM-1096) Provide @CompensatedBy annotation

Paul Robinson (JIRA) jira-events at lists.jboss.org
Sat May 19 04:33:18 EDT 2012

    [ https://issues.jboss.org/browse/JBTM-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694148#comment-12694148 ] 

Paul Robinson commented on JBTM-1096:

The work in the "doWork" method should not be made permanent until the confirmCompleted(true) is invoked. This closes the window between "doWork" completion and writing of the recovery log.

As a result, I think we need a @ConfirmedBy(methodName="...") annotation (or some similar mechanism). This is called when confirmCompleted(true) occurs. If confirmCompleted(false) occurs, then we might get away with calling the @CompensatedBy method. This may be misleading as the spec says that Compensate is only invoked after a participant has completed. In the case where the recovery log was not written, the participant never completed successfully. 
> Provide @CompensatedBy annotation
> ---------------------------------
>                 Key: JBTM-1096
>                 URL: https://issues.jboss.org/browse/JBTM-1096
>             Project: JBoss Transaction Manager
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: TXFramework
>            Reporter: Paul Robinson
>            Assignee: Paul Robinson
>             Fix For: 5.0.1.Final
>   Original Estimate: 2 days
>          Time Spent: 1 day, 4 hours
>  Remaining Estimate: 4 hours
> For example, take this business logic:
> {code}
>     public class LifecycleImpl
>     {
>         @CompensatedBy(methodName="compensate1")
>         public void doWork1()
>         {
>              //Do work1
>         }
>         @CompensatedBy(methodName="compensate2")
>         public void doWork2()
>         {
>              //Do work2
>         }
>         public void compensate1()
>         {
>              //Compensate work1
>         }
>         public void compensate2()
>         {
>              //Compensate work2
>         }
>     }
> {code}
> Here different compensation methods are specified for the business logic methods 'doWork1' and 'doWork2'. For each call to doWork1, there needs to be a compensation participant registered in that BA, configured with the right compensate method. I think a developer would expect one call of the corresponding compensate, per call to doWorkX. I think the developer would also expect some way of knowing what work they where compensating. For example, having matching parameters and values for the work and compensate methods would allow the compensate to know what it was compensating.
> This is not going to be trivial to implement as it will probably require some re-factoring to work.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbossts-issues mailing list