Progress
Language Tutorial
for Windows
Releasing Records
When you make changes to a record buffer, Progress knows that those changes are intended for the database. Progress does not, however, write changes to the database as it receives them in the record buffer.
Progress makes the changes to the database only when your procedure is done with the record. Progress understands when you are finished with a record because the rules that determine how long a record stays in a record buffer are enforced by the 4GL. The life span of a record in a record buffer is called the scope of the record. When the scope of a record ends, Progress releases the record and surrenders it to the RDBMS. The RDBMS has its own rules for determining when it is safe and efficient to write the record to the database.
The basic rule for determining the scope of a record is that the scope lasts from the moment the record is retrieved until:
As a general rule, you could say that a record’s scope ends on a new record request or an END statement. That statement is subject to many exceptions and some special situations where Progress allows you to bend the rules. As you work through this tutorial, the general rule of thumb holds. When you finish working with the tutorial, you can read more about record scoping in the Progress Programming Handbook .
Earlier in the tutorial, you learned that Progress can create and maintain a separate record buffer for each database table. Actually, each block that can own a record buffer can have a separate record buffer for the same database table. Blocks that can have buffers include:
If a block is not capable of owning its own buffer then it uses the buffer of the block in which it resides. So, unless you have heavily nested blocks, the block uses its own buffer or the main procedure block’s buffer.
The idea of multiple buffers is important because it means your procedures can work on more than one record from a table at a time.
Explicit Release
You can end the scope of a record prematurely by forcing Progress to release it with the RELEASE statement.
This is the syntax for the RELEASE statement.
Figure 8–13 shows the data movement of RELEASE.
Figure 8–13: Data Movement with the RELEASE Statement
![]()
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |