cancel
Showing results for 
Search instead for 
Did you mean: 

DI - Closing Global Transaction

Former Member
0 Kudos

Hello everybody.

While working with global transaction, I noticed that if any <i>Add()</i> method of some object fails, then calling the <i>EndTransaction()</i> method (with <i>SAPbobsCOM.BoWfTransOpt</i> parameter set to <i>wf_RollBack</i>) will also fail. You will get the following exception :

ErrorCode="-1109"

Message="There is no active transaction in progress"

TargetSite="Void EndTransaction(SAPbobsCOM.BoWfTransOpt)"

This, I suspect, means that the rollback is done automatically when any(?) exception occurs and a global transaction is open.

Is that right?

Thanks for your feedback.

Cheers

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Cyril

That is totally right.

If anything fails during a transaction, the transaction automatically fails and ends and the rollback is performed.

What I do, is to check before the commit, if I'm in a transaction. If yes, ok, no problem, if the transaction ended, then you know there is an error and can exit to the exception routine.

You can always check for the status of the transaction with: ocompany.InTransaction = True

Harold

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

I completely agree with Harold.

In case an action fails during a transaction then an automatic rollback is done.

The InTransaction property must allways be checked before calling StartTransaction and EndTransaction.

Regards

Trinidad.

Former Member
0 Kudos

Thanks to both of you for your feedback.

My interface is now working fine (at least on this point)

Cheers,

Cyril

Answers (0)