Một tác vụ bulk-import xử lý 15.000 template giao dịch đã khiến hệ thống crash do lỗi Cartesian product của Hibernate. JPQL query dùng JOIN FETCH trên hai collection cùng lúc khiến Hibernate cross-join chúng, biến ~11.000 bản ghi thành 50 triệu dòng trong bộ nhớ. Lỗi này không lộ ra trong test nhỏ vì các collection được mapping dưới dạng Set thay vì List (lẽ ra phải ném MultipleBagFetchException khi khởi động). Giải pháp là tách query thành hai lần fetch riêng biệt, dùng @BatchSize để tải batch, và flush/clear session Hibernate định kỳ trong quá trình import lâu dài, giúp giảm 9 lần số dòng và cải thiện tốc độ xử lý lên 15 lần.
AI summaries can be wrong. Read the original before relying on anything important.
Why read it: Lập trình viên nên đọc bài này để tránh rủi ro như biến vấn đề JOIN FETCH thành Cartesian product khổng lồ, gây sập ứng dụng do quá tải bộ nhớ trong các dự án bulk import lớn.
Answer 3 short questions to earn reward points for this article. Only do it if you want the points.
3 questions · under a minute · optional
Source: https://code.likeagirl.io/hibernate-turned-11-000-records-into-50-million-rows-2927c5886dca. 8 Sync News only summarizes and links out; content copyright belongs to the authors and original sources.
Read the news here, practice coding, follow structured courses and train for IELTS on our sibling products — all connected through one 8 Sync account.
The ecosystem home: product overviews, blog and full pricing.
ExploreLearn along a clear roadmap: videos, auto-graded quizzes, certificates and mentors who ship for a living.
View the roadmap1,000 DSA problems in Vietnamese, auto-graded across 7 languages — many FREE, right in your browser.
Practice for freeAI grading for all four IELTS skills with detailed rubric feedback.
Try it freeA 22 MB AI IDE for Vietnamese devs.
Download freeOrganizational memory for AI agents.
ExploreAI that staffs your Fanpage and qualifies leads for you.
Try itIn this article, we will provide a technical overview and some key usage instructions for the G1 Garbage Collector, the default collector on the JVM.
Codename One now builds Flutter apps from their Dart source, and the result starts faster and uses less memory than Flutter's own release build on Android,...
Use an ArchUnit test to check a Java module boundary, examine a violation and move the dependency behind the module's API.
The Netflix engineering team has developed an autonomous performance agent system. In this article, we’ll be learning more about it.
Java Swing testing for real installed apps, with plain-language steps instead of component names.
AI đang thay thế các nhiệm vụ cơ bản, khiến lập trình viên mới khó tìm việc. Các công ty giờ cần kỹ sư cấp cao để sửa lỗi code do AI sinh ra. Lập trình viên nên dùng AI hỗ trợ giải quyết vấn đề thay vì viết code trực tiếp, đồng thời nắm vững công việc của mình để cải thiện thiết kế hệ thống và xử lý vấn đề tương lai.
Là một lập trình viên, đọc bài này giúp bạn hiểu cách AI không thay thế kỹ năng sáng tạo và quản lý dự án của bạn mà chỉ là công cụ hỗ trợ, giúp bạn nâng cao vị trí và hiệu suất trong công việc.
Spring's @RequestPart cannot stream multipart uploads — not even FilePart. The API that actually does, and the tests that prove it.
Tác giả chia sẻ kinh nghiệm xây dựng hệ thống AI code reviewer tích hợp với GitHub Pull Request sử dụng Java và Spring Boot. Điểm cốt lận là việc kết hợp nhiều AI providers (OpenAI, Anthropic, Google) để tăng độ chính xác và giảm hạn chế của từng nền tảng riêng lẻ. Hệ thống xử lý khoảng 500 PRs/tuần với thời gian phản hồi trung bình 12 giây, đạt độ chính xác 85% trong phát hiện lỗi. Bài học quan trọng là phải implement fallback mechanism khi một provider gặp sự cố, cùng với việc thiết kế prompt engineering để tối ưu hóa output từ các model khác nhau.
Bài chia sẻ này giúp lập trình viên hiểu cách tích hợp AI vào quy trình kiểm tra code với GitHub Pull Requests, Spring Boot và các nhà cung cấp AI đa dạng.
Loading comments…