عرض عملي: مراقبة سياق الاستمرارية عبر تسجيل SQL
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
see when SQL really runs; prepares JNR-027-LAB1 and JNR-028.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Enable
spring.jpa.show-sql(orlogging.level.org.hibernate.SQL=DEBUG) in a throwaway sandbox project. - Call
findtwice for the same id inside one transaction; count the selects (one). - Change a field on the loaded entity and print a marker line before the transaction ends; show the update appears after the marker, at commit.
- Planned mistake: call
findoutside any transaction and change a field; show nothing is saved, then add a transaction. - Summarize: identity map avoided a query, unit of work delayed the update.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.