انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-016-L04

الانتشار (Propagation) بعمق

  • الدرس 4 من 7
  • Mid-level
في هذا الدرس 4 موضوعات

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

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

في هذا الدرس

use propagation settings and know their traps.

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

  • REQUIRED (default): join the current transaction or start one.
  • REQUIRES_NEW: suspend the current transaction and start an independent one, with its own connection; it commits or fails on its own.
  • NESTED: a savepoint inside the current transaction (needs JDBC savepoint support); rollback goes back to the savepoint only.
  • Traps: self-invocation bypasses the proxy so annotations are ignored; REQUIRES_NEW needs a second connection, which can exhaust the pool; a caught runtime exception may still mark the shared transaction rollback-only.
تفاصيل المخطط المبدئي

عرض عملي

a table of the three propagations and a code sketch of a service calling another bean's @Transactional(propagation = REQUIRES_NEW) method.

اختبر فهمك

Why can REQUIRES_NEW exhaust the pool?

أظهر الإجابة

Each nested call holds a second connection while the outer one is still held.

التطبيق

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

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

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

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