المكتبة التقنية ←

منع فقد التعديلات في APEX Forms

English version

Two people can open the same record and both receive a successful save message while one overwrites the other's changes. Optimistic concurrency checks help detect that conflict.

In a supported APEX Form, configure Lost Update Type on the Form region and enable Prevent Lost Updates on its corresponding Automatic Row Processing process. Row Values compares a checksum of updateable values. Row Version Column uses a column that changes on every update; Oracle does not recommend that option when a form updates multiple tables.

When a conflict occurs, explain that the record changed and let the user review the latest data. Automatic merging requires its own business rules. A separate custom UPDATE process also needs its own concurrency design.

Test with two separate sessions: open the same record, save a change in the first, then try to save the stale second copy. Confirm that the second write is rejected and the first change remains.

Reference: Oracle lost update detection.

النسخة العربية

مستخدمان ممكن يفتحوا نفس السجل، وكل واحد يشوف رسالة حفظ ناجح، ومع ذلك تعديل واحد يختفي بسبب حفظ نسخة قديمة.

في APEX Form المدعومة، اضبط Lost Update Type في خصائص الـForm Region وفعل Prevent Lost Updates في Automatic Row Processing المرتبطة بها. Row Values تقارن بصمة القيم القابلة للتحديث. Row Version Column تعتمد على عمود يتغير مع كل تحديث؛ Oracle لا توصي به عند تعديل عدة جداول من النموذج نفسه.

عند التعارض، وضح للمستخدم أن البيانات اتغيرت واطلب مراجعة أحدث نسخة. دمج التعديلات تلقائيًا يحتاج قواعد عمل منفصلة. ولو عندك UPDATE مستقل خارج المعالجة المدمجة، صمم له فحص تعارض مناسب.

اختبر بجلستين منفصلتين: افتح نفس السجل، احفظ من الأولى، ثم حاول حفظ النسخة القديمة من الثانية. تأكد أن الحفظ الثاني يتوقف وأن التعديل الأول يظل موجودًا.

المرجع: توثيق Oracle لمنع فقد التعديلات.