It's all about the answers!

Ask a question

Run service requests from a failed deliver operation


Gabriel Lopez de Armas (10189) | asked Oct 28 '14, 4:16 p.m.
We are modifying the Build On Deliver code:
http://jorgediazblog.wordpress.com/2013/01/24/rtc-build-on-deliver-participant/
To better suit our needs. One case is that we want to do the build request even if the deliver fails.
Surprisingly, when this happens, although the build seems to be requested successfully, this operation doesn't get "committed". 
The IBuildRequest UUID object returned from this request doesn't exist, and we never see a new build queueing up.

It looks like all operations done (including calling other service, like ITeamBuildRequest) are never "committed" (or are being rolled back) if the operation fails. Is this intentional behavior? Is there a way to override it?

Comments
Donald Nong commented Oct 28 '14, 9:00 p.m.

To my knowledge, as long as an operation fails, everything rolls back. Otherwise, you will get partially commits and you will consider it as "broken".


Gabriel Lopez de Armas commented Oct 29 '14, 4:47 a.m.

 Is there a way to override this behaviour? 

Say, for example, that we want to comment in a work item the error a developer hit when executing a deliver. Is this possible?

One answer



permanent link
Gabriel Lopez de Armas (10189) | answered Oct 29 '14, 9:54 a.m.
Replying to myself:

If you ever need to "commit" a change from inside a transaction context, independent if the transaction succeeds or not, you can use ITransactionService#executeTaskAfterCurrentOutermostTransaction(), and implement a AbstractPostOutermostTransactionTask that does whatever you want to commit. It will be done after the transaction finishes.
This reply has more information about it: https://jazz.net/forum/questions/32947/handling-long-running-asynchronous-jobs-on-rtc-server.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.