cancel
Showing results for 
Search instead for 
Did you mean: 

BOL transaction rollback not working properly

Former Member
0 Kudos

Hi Experts,

I am programming a mass processing for business partners and encountered following problem:

Say I lock the first business partner in my list and encounter an error in the processing, I then call entity->get_transaction( )->rollback( ).

If I then process the next business partner, lock it and process successfully, ending with save and commit, changes that I made on the first entity are also committed.

It seems to me that the rollback only affects GenIL and not BOL.

How do I clear the modifications to entity 1 out of the BOL without losing the entity from my collection?

I would like to avoid using the BOL core reset or other methods that will lose the information from my collections.

Thanks for any input.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Euan,

Use Revert instead of rollback to discard the changes.

Regards,

Shobhit

Former Member
0 Kudos

Hi Shobhit,

thanks for your response. You're right, I was mixing up revert and rollback.

I also had to add  lr_entity->reread( iv_invalidate_children = abap_true ) though, now it works how I wanted it.

Regards,
Euan

former_member188346
Active Participant
0 Kudos

Hi Shobhit,

Then what is the the difference between rollback and revert. I hope you dont mind answering this out of discussion question.

Thanks

Bhushan

Former Member
0 Kudos

Hi Bhushan,

If you are saving any object then based on your validation if it's passed then you have to commit or if there is some error then you will rollback, so to close the transaction cycle you have to either use commit or rollback. Better use CHECK_SAVE_POSSIBLE to avoid any errors.

Revert can be used separately as well example you did some changes to bol attributes and you decide to cancel that operation then revert will be used which will reset the buffer state, release the lock and sync with latest saving state from DB.

Both rollback and revert finally does the same thing but used in different phase of transaction cycle.

Regards,

Shobhit

former_member188346
Active Participant
0 Kudos

Thanks for the explaination Shobhit

Answers (0)