Attempt to disconnect a ter record, which is running a trigg

Posted by terry_b on 06-Oct-2016 12:06


We have a trigger that calls program a.p.  This program makes a persistent call to b.p, runs an internal procedure and then when its done it deletes the handle to b.p.

Under some circumstances when the handle to b.p is deleted ( DELETE PROCEDURE hHandle_b.p)

We get the error "Attempt to disconnect a <table> record, which is running a trigger. (2869)" and the program crashes. Any ideas as to the cause? At this time my only option is to not call b.p persistently.


All Replies

Posted by Brian K. Maher on 06-Oct-2016 12:12

The details for error 2869 are as follows:
Inside a database trigger procedure, you cannot do anything to release the record that is the object of the trigger.  You cannot execute a RELEASE statement that would release the record, nor can you execute any FIND or FOR EACH that would read any record into the same buffer (this would force a RELEASE of the current record).
Is your code doing anything like this?  Perhaps defining alternate buffers in b.p would help.

Posted by Andriy Kudelya on 06-Oct-2016 12:40

The DELETE PROCEDURE statement disconnects any local buffers established by the procedure. In addition, any buffers passed as parameters to a persistent procedure are treated as local buffers. While all cursor positioning established on these buffers by the persistent procedure is lost, there is no affect on the original buffers passed as parameters from the caller. Note that all buffers are validated before being disconnected (which might cause database write triggers to execute). If the validation fails, the DELETE PROCEDURE statement raises the ERROR condition and pends the deletion until the validation succeeds and all database write triggers have completed. 


This thread is closed