how to rollback the records when system failure in progress 4GL

ravikanth.ntd

New Member
I want to update the records for a scenario.

If i want to update a 100 records ,while updating at 97 record the system crash occurred ,will it be do UNDO operation or And how i can rollback the records ,can any one send the code to me
 

tamhas

ProgressTalk.com Sponsor
What it does will depend on what is defined as a transaction. Use COMPILE LIST to see where the transactions are. Use the transaction keyword to scope the transaction to the desired block. You can either make each update independent or make all of the updates a single transaction.
 

TomBascom

Curmudgeon
If it is within the scope of a transaction then the rollback is automatic. There is nothing for you to do.

If not within a transaction then you need to rethink your code or your requirements.
 

Cringer

ProgressTalk.com Moderator
Staff member
Be aware that large transaction is generally bad practise. You want your transactions to be tight and quick. If you're updating a lot of information with a chance the transaction might roll back then obviously the system has to keep a track of this. Your BI will grow, and you'll probably run into lock table overflows.
An all or nothing approach like you describe needs some very careful thought and should only be used where absolutely necessary.
 

RealHeavyDude

Well-Known Member
The Progress OpenEdge database has a built-in crash recovery that automatically will roll back open transactions as soon as you restart the database. Therefore you will not find any sane code that attempts to roll back anything manually. For that the database uses the BI ( before image ) which contains the corresponding transaction notes. Plus, the ABL does not bear the necessity to explicitely commit or rollback a transaction like SQL does. This is a concept of SQL - not ABL.

It is the transaction scope that decides what gets rolled back when something bad happens to your system ( being it a crash of your client or your database ). As Cringer already outlined, the golden rule for transaction is: As small as possible - as large absolutely necessary. You can either have the compiler take care of the transaction scope for you automatically or you can deliberately define the transaction scope with your code ( which is what I prefer ). Nevertheless, this is a basic concept of the ABL and therefore you should have a look into the "Managing transactions" in the ABL essentials documentation - which you can find here https://community.progress.com/comm....openedge-product-documentation-overview.aspx

Heavy Regards, RealHeavyDude.
 
Top