首页 > 数据库 > Oracle > 【EBS FORM】ON_LOCK触发器相关
ON-LOCK触发器的触发时机
帮助中说
Fires whenever Form Builder would normally attempt to lock a row, such as when an operator presses a key to modify data in an item. The trigger fires between the keypress and the display of the modified data. ”
FORM端的ON-LOCK触发器用于获取oracle数据表的行级排他锁
当ON-LOCK 触发器fire时,他会试图去获得这个锁,如果这时没有其它session获得这个锁,或者说其它session己经释放这个锁,那么我们的form会很顺利的获得。否则会抛出app_exceptions.record_lock_exception异常。
一般我们会写一个loop ..end loop;块出来,再定义一个计数器counter计录循环次数,把它作为参数传入到app_exception.record_lock_error(counter)处理过程中,在form中会弹出message,用于用户选择是否继续试图获得lock,或中止procedure的执行。在app_exception.record_lock_error()过程的最后,会raise一个form_trigger_failure的异常。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29599494/viewspace-2113023/ ,如需转载,请注明出处,否则将追究法律责任。