Kbase P126802: Cannot see schema changes applied online
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  29/12/2008 |
|
Status: Verified
SYMPTOM(s):
Cannot see schema changes added on-line
adding new objects on-line from *.df file
Adding new fields to existing table with "Add new objects on-line" option in "Load Data Definitions" frame
New fields are seen in "Detailed Table Report" in Data Dictionary
From the same session (as the .df has been loaded), the new fields are not seen
from an_other session, where this table has been previously queried, the new fields are not picked up
buffer_handle:BUFFER-FIELD("my_new_field") doesn"t work errors 7351, 10068
BUFFER-FIELD <field-name> was not found in buffer <buffer-name>. (7351)
Lead attributes in a chained-attribute expression (a:b:c) must be type HANDLE or a user-defined type and valid (not UNKNOWN). (10068)
SYSTEM ERROR: Cannot read field from record, not enough fields. (450)
SYSTEM ERROR: Failed to extract field <field-num> from <file-name> record (table <table-num>) with recid <RECID>. (3191)
Couldn't extract field '<field>' from source in a BUFFER-COPY statement. (5367)
a new client session finds the newly added objects
If new objects are added **without** "Add new objects on-line" option new objects are found
FACT(s) (Environment):
OpenEdge 10.1x
All Supported Operating Systems
CAUSE:
Starting in OpenEdge 10.1A, Progress relaxed the requirement for exclusive access to a database by allowing for the addition of sequences, 4GL tables and any fields, indexes, and database triggers associated with a new and existing tables (in later 10.1x releases) as long as they are added in the same transaction as the table. The behaviour is expected.
FIX:
Decide how to employ the new feature in OpenEdge 10.1x when making schema changes online:When "Add new objects-online" is selected:
- the client applying the schema change will not require a schema lock and
- no client that is already connected and working with its cache is required to re-cache. iow: They keep working with the cache they have currently - hence will not see the new objects added online until such time as they re-connect.
Adding new objects without the "Add new objects-online" option, in effect no-one can be running any code against that database, since the client applying the schema change will need to acquire a schema lock first.
The primary reason behind this is that to add fields to an existing table in general requires the database to be in single-user mode because the client requires a schema lock, so in effect no session can be running any program that accesses the database - hence the administrator first needs to kick everyone out.
With the introduction of "Add new objects-online" option, the client is not longer required to first acquire a schema lock, and any client that is connected to that database will continue to run with its current schema cache. This is why the new field is not seen by the current session. To be able to see the changes, in this scenario, current sessions that have either read the table in question, or the schema is referenced in r-code, which places the table definition in the current schema cache - will need to disconnect from the database and reconnect to see the changes. Using the "Add new objects-online" option, any client connected remains using the existing schema cache and down time is minimized.
Essentially this is a compromise between application downtime while schema-changes are being applied (after the schema-lock is granted) or client sessions that access the specific schema in the application, re-connecting.