انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-031-L06

المعاملات الطويلة والاستدعاءات البعيدة

  • الدرس 6 من 8
  • Junior
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

keep transactions short.

الموضوعات المخطط لها

  • A transaction holds a database connection and locks while it is open.
  • Never call a payment API, email service, or any slow remote system inside it.
  • A remote call cannot be rolled back with the database.
  • Do remote work before or after the transaction, or use an event/outbox later (MID level).
  • Long transactions starve the connection pool.
تفاصيل المخطط المبدئي

عرض عملي

a timeline: prepare (no transaction) → transaction: reserve stock, save order → commit → call payment/email.

اختبر فهمك

Why not call a payment API inside the transaction?

أظهر الإجابة

It holds a connection and locks, and the payment cannot be rolled back.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

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

اكتب للبحث في المستويات والمراحل والوحدات والدروس.