Kbase P132184: 4GL/ABL: Error (7351) generated by WRITE trigger executing BUFFER-FIELD method.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/25/2010 |
|
Status: Verified
SYMPTOM(s):
4GL/ABL: Error (7351) generated by WRITE trigger executing BUFFER-FIELD method.
BUFFER-FIELD <field-name> was not found in buffer <buffer-name>. (7351)
BUFFER-FIELD State was not found in buffer State. (7351)
The table buffer handle BUFFER-FIELD() method fails.
The table buffer handle is deleted before the end of the transaction that caused the WRITE trigger to fire using code similar to the following:
DO TRANSACTION:
hStateBuffer:BUFFER-CREATE ( ).
hBufferField = hStateBuffer:BUFFER-FIELD("State").
hBufferField:BUFFER-VALUE = "ZZ".
DELETE OBJECT hStateBuffer.
END.
The table WRITE trigger has code similar to the following:
ON WRITE OF State NEW NewState OLD OldState
DO:
DEFINE VARIABLE hNewState AS HANDLE NO-UNDO.
DEFINE VARIABLE hOldState AS HANDLE NO-UNDO.
hNewState = BUFFER NewState:HANDLE.
hOldState = BUFFER OldState:HANDLE.
/* The table buffer handle is valid, some attributes are accessable and some methods are not */
MESSAGE
"Table Buffer Handle valid?:~t " VALID-HANDLE(hNewState) "~n"
"NAME Attribute:~t~t " hNewState:NAME "~n"
"NUM-FIELDS attribute:~t " hNewState:NUM-FIELDS "~n"
"TYPE Attribute:~t~t " hNewState:TYPE "~n"
"INDEX-INFORMATION:~t " hNewState:INDEX-INFORMATION( )
VIEW-AS ALERT-BOX INFO BUTTONS OK.
MESSAGE "BUFFER-FIELD method:~t" hStateBuffer:BUFFER-FIELD("State")
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
The table buffer handle is still valid, some attributes are still accessible and some methods are still callable.
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1x
OpenEdge 10.2A
OpenEdge Category: Language (4GL/ABL)
CAUSE:
Bug# OE00169932
FIX:
Upgrade to OpenEdge 10.2B or later
A workaround is to force a database WRITE by calling the FIND-CURRENT() or the BUFFER-RELEASE() buffer method before the DELETE OBJECT statement. For example:
DO TRANSACTION:
hStateBuffer:BUFFER-CREATE ( ).
hBufferField = hStateBuffer:BUFFER-FIELD("State").
hBufferField:BUFFER-VALUE = "MA".
hStateBuffer:BUFFER-RELEASE ( ).
DELETE OBJECT hStateBuffer.
END.
Or
DO TRANSACTION:
hStateBuffer:BUFFER-CREATE ( ).
hBufferField = hStateBuffer:BUFFER-FIELD("State").
hBufferField:BUFFER-VALUE = "MA".
hStateBuffer:FIND-CURRENT( ).
DELETE OBJECT hStateBuffer.
END.