on 04-17-2014 7:55 AM
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.
Hi Euan,
Use Revert instead of rollback to discard the changes.
Regards,
Shobhit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.