Java Companion
Author

Java Companion

A highly professional Java public account

88
Articles
0
Likes
8
Views
0
Comments
Recent Articles

Latest from Java Companion

88 recent articles
Java Companion
Java Companion
Feb 21, 2026 · Backend Development

Build Your Own Spring Boot API Guard: Anti‑Duplicate Submissions and Rate Limiting

The article introduces Guardian, a lightweight Spring Boot starter that provides independent anti‑duplicate‑submission and rate‑limiting modules, explains why a custom solution is preferable to raw Redis locks, and walks through annotation and YAML configurations, key generation, response handling, storage options, concurrency safety, and observability.

API GuardAnnotationAnti-duplicate Submission
0 likes · 17 min read
Build Your Own Spring Boot API Guard: Anti‑Duplicate Submissions and Rate Limiting
Java Companion
Java Companion
Feb 10, 2026 · Backend Development

Why Successful Payments Vanished: MyBatis Connection‑Pool Pitfalls Explained

A production incident where payment orders appeared successful but were not persisted was traced to a missing commit in a special‑case branch, causing a polluted connection to be reused by Spring's transaction manager, leading to intermittent failures that were resolved by fixing the commit logic and adding connection‑pool health checks.

Connection PoolDatabase MonitoringHikariCP
0 likes · 10 min read
Why Successful Payments Vanished: MyBatis Connection‑Pool Pitfalls Explained
Java Companion
Java Companion
Feb 7, 2026 · Backend Development

Why Should the Service Layer in Java Not Return a Result Object Directly?

The article explains that returning a Result wrapper from the Service layer mixes business logic with presentation concerns, leading to tighter coupling, reduced reusability, cumbersome error handling, harder testing, poorer DDD alignment, limited interface flexibility, and ambiguous transaction boundaries.

Domain-Driven DesignJavaResult Wrapper
0 likes · 11 min read
Why Should the Service Layer in Java Not Return a Result Object Directly?
Java Companion
Java Companion
Feb 3, 2026 · Backend Development

Build Standalone Installers for Spring Boot Apps with JPackage

This guide walks through using JPackage (standard from JDK 16) to create native Windows, macOS, and Linux installers for Spring Boot applications, covering JDK requirements, platform‑specific tools, custom JRE creation with jlink, Maven integration, and step‑by‑step command examples.

JLinkLinuxSpring Boot
0 likes · 12 min read
Build Standalone Installers for Spring Boot Apps with JPackage
Java Companion
Java Companion
Feb 1, 2026 · Databases

How I Completed a 100+ Table Migration in One Month Using Navicat Tricks

In under a month the author migrated more than 100 heterogeneous tables from MySQL and MongoDB to PostgreSQL across isolated networks by automating Navicat's import/export logic, streaming data, handling special characters, configuring flexible sync strategies, and using OSS as a bridge to avoid OOM and lock‑contention.

MongoDBMySQLNavicat
0 likes · 20 min read
How I Completed a 100+ Table Migration in One Month Using Navicat Tricks
Java Companion
Java Companion
Jan 30, 2026 · Backend Development

When @Transactional and TransactionTemplate Clash: How to Choose the Right Spring Transaction Management

This article examines Spring's three transaction management options—@Transactional, TransactionTemplate, and TransactionManager—explaining their mechanisms, common pitfalls such as internal method calls and timeout settings, and provides guidance on when to use each approach with concrete code examples.

SpringTransactionManagerTransactional
0 likes · 12 min read
When @Transactional and TransactionTemplate Clash: How to Choose the Right Spring Transaction Management
Java Companion
Java Companion
Jan 29, 2026 · Backend Development

How to Cut MyBatis Batch Insert Time from 5 Minutes to 3 Seconds: Three Key Optimizations

The article walks through turning a naïve MyBatis loop that took five minutes to insert 100,000 rows into a high‑performance solution that finishes in three seconds by applying batch SQL, JDBC batch mode with rewriteBatchedStatements, and multithreaded parallel execution, while highlighting pitfalls and best‑practice configurations.

Batch InsertExecutorType.BATCHJDBC
0 likes · 9 min read
How to Cut MyBatis Batch Insert Time from 5 Minutes to 3 Seconds: Three Key Optimizations
Java Companion
Java Companion
Jan 23, 2026 · Backend Development

Maven 4 Officially Announced: A 15‑Year Overhaul of Java’s Build Tool

Maven 4, now in its fifth release candidate, modernizes the 15‑year‑old Java build ecosystem with a new POM model, native Build/Consumer POM separation, explicit artifact types, subproject renaming, tree‑based lifecycle for parallel builds, and richer configuration options, while providing an official upgrade assistant.

Artifact TypesBuild ToolJava
0 likes · 9 min read
Maven 4 Officially Announced: A 15‑Year Overhaul of Java’s Build Tool
Java Companion
Java Companion
Jan 20, 2026 · Backend Development

How to Integrate Spring Boot with Third‑Party APIs: HTTP Clients, Sync Strategies, and Code Samples

This article explains how to connect Spring Boot to external services by choosing the appropriate HTTP client (RestTemplate, Feign, WebClient), configuring beans, implementing service methods, and applying various data‑synchronization techniques such as full sync, UPSERT, incremental sync, webhook callbacks, and message‑queue based replication.

Incremental SyncMessage QueueSpring Boot
0 likes · 20 min read
How to Integrate Spring Boot with Third‑Party APIs: HTTP Clients, Sync Strategies, and Code Samples