Tagged articles
26 articles
Page 1 of 1
SpringMeng
SpringMeng
Jan 16, 2026 · Backend Development

What Unexpected Pitfalls PageHelper Can Teach You After Years of Use

The article recounts a developer’s painful experience with PageHelper, detailing how duplicate registrations, truncated result sets, and password‑update errors stem from the plugin’s ThreadLocal pagination handling, and explains the underlying code paths and safe usage practices.

BackendMyBatisThreadLocal
0 likes · 13 min read
What Unexpected Pitfalls PageHelper Can Teach You After Years of Use
macrozheng
macrozheng
Jan 6, 2026 · Backend Development

Why PageHelper Can Break Your MyBatis Queries and How to Fix It

The article examines unexpected bugs caused by PageHelper’s hidden LIMIT clause injection in MyBatis projects, explains how ThreadLocal pagination parameters persist across requests, and provides practical guidelines and code examples to avoid and clean up these issues.

MyBatisThreadLocaljava
0 likes · 13 min read
Why PageHelper Can Break Your MyBatis Queries and How to Fix It
Lobster Programming
Lobster Programming
Dec 15, 2025 · Backend Development

5 Ways to Implement Pagination in MyBatis: From Manual SQL to PageHelper

This article compares five MyBatis pagination techniques—including raw LIMIT SQL, RowBounds, custom window‑function queries, interceptor‑based pagination, and the PageHelper plugin—explaining their principles, code examples, performance trade‑offs, and ideal usage scenarios.

BackendMyBatisRowBounds
0 likes · 6 min read
5 Ways to Implement Pagination in MyBatis: From Manual SQL to PageHelper
Selected Java Interview Questions
Selected Java Interview Questions
Apr 10, 2025 · Backend Development

Understanding PageHelper Issues and ThreadLocal Pitfalls in MyBatis

This article analyzes unexpected behaviors caused by PageHelper in a Java backend project, such as duplicate user registration, limited query results, and password‑reset errors, and explains how ThreadLocal pagination parameters, startPage(), and cleanup mechanisms lead to these problems while offering practical debugging tips.

BackendMyBatisThreadLocal
0 likes · 11 min read
Understanding PageHelper Issues and ThreadLocal Pitfalls in MyBatis
Code Ape Tech Column
Code Ape Tech Column
May 4, 2024 · Backend Development

Understanding PageHelper Pagination Issues and ThreadLocal Management in MyBatis

This article analyzes common anomalies caused by the PageHelper pagination plugin in a Java backend project—such as duplicate user registration, limited query results, and password‑reset errors—traces them to ThreadLocal misuse, explains the internal workflow of startPage, getLocalPage, and clearPage, and offers practical recommendations to avoid these pitfalls.

BackendMyBatisThreadLocal
0 likes · 11 min read
Understanding PageHelper Pagination Issues and ThreadLocal Management in MyBatis
JD Tech
JD Tech
Mar 6, 2024 · Backend Development

Fixing Incorrect Total Count in PageHelper Pagination Using PageInfo

This article analyzes why the total record count returned by PageHelper mismatches the actual number of rows, examines the underlying PageInfo and PageSerializable source code, and provides a concrete solution that avoids type conversion and directly constructs PageInfo from the mapper result to ensure accurate pagination.

BackendMyBatisPageInfo
0 likes · 7 min read
Fixing Incorrect Total Count in PageHelper Pagination Using PageInfo
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Feb 26, 2024 · Backend Development

Understanding and Configuring Pagination Rationalization with MyBatis PageHelper in SpringBoot

This article explains pagination rationalization in SpringBoot using MyBatis PageHelper, illustrates common unreasonable pagination scenarios, demonstrates a bug caused by page deletion, and shows how a simple two‑line configuration or per‑query setting resolves the issue while detailing the underlying implementation.

BackendMyBatisSpringBoot
0 likes · 8 min read
Understanding and Configuring Pagination Rationalization with MyBatis PageHelper in SpringBoot
Java Tech Enthusiast
Java Tech Enthusiast
Feb 9, 2024 · Backend Development

Understanding PageHelper Issues and ThreadLocal in MyBatis Pagination

Unexpected duplicate registrations, truncated query results, and password‑reset SQL errors in a Java backend were traced to PageHelper’s ThreadLocal pagination state persisting across requests when startPage() is called without immediate query execution, so developers should ensure immediate execution or manually clear the ThreadLocal to prevent stale LIMIT clauses.

MyBatisThreadLocaljava
0 likes · 12 min read
Understanding PageHelper Issues and ThreadLocal in MyBatis Pagination
Sanyou's Java Diary
Sanyou's Java Diary
Dec 4, 2023 · Backend Development

When Pagination Breaks: Real‑World Bugs and Practical Fixes

This article recounts three production‑level pagination bugs encountered in a payment system, explains why they occurred—ranging from naive batch processing to MySQL's nondeterministic LIMIT behavior—and shows how proper pagination, ThreadLocal cleanup, and deterministic ordering resolve the issues.

Backendbug fixingmysql
0 likes · 16 min read
When Pagination Breaks: Real‑World Bugs and Practical Fixes
macrozheng
macrozheng
Nov 6, 2023 · Backend Development

Mastering MyBatis PageHelper: Avoid Common Pagination Pitfalls

This article explains the core principles and multiple usage patterns of MyBatis PageHelper for pagination, demonstrates code examples, details its internal ThreadLocal and interceptor mechanisms, and highlights common pitfalls with safe versus unsafe practices to ensure reliable data retrieval.

MyBatisjavapagehelper
0 likes · 9 min read
Mastering MyBatis PageHelper: Avoid Common Pagination Pitfalls
dbaplus Community
dbaplus Community
Nov 5, 2023 · Backend Development

Three Hidden Pagination Pitfalls That Can Break Your Production System

The article recounts three real‑world pagination bugs—batch‑processing loops, misuse of MyBatis PageHelper, and nondeterministic results from identical ORDER BY values—explaining why they occur, how they manifest in production, and concrete fixes to avoid data loss or endless loops.

MyBatismysqlpagehelper
0 likes · 15 min read
Three Hidden Pagination Pitfalls That Can Break Your Production System
Top Architect
Top Architect
Mar 31, 2023 · Backend Development

Why MyBatis PageHelper Pagination Is Slow and How to Optimize It

The article explains that MyBatis PageHelper performs an extra full‑table count query causing pagination to take over eight seconds on a 10,000‑row table, analyzes the root cause, and provides a concrete solution by customizing the count SQL with a _COUNT method and optimized mapper definitions.

MyBatisSQL Optimizationbackend-development
0 likes · 6 min read
Why MyBatis PageHelper Pagination Is Slow and How to Optimize It
Programmer DD
Programmer DD
Aug 21, 2022 · Backend Development

Why PageHelper Can Break Your MyBatis Queries: Hidden ThreadLocal Pitfalls

This article examines unexpected bugs caused by PageHelper in a Java/MyBatis project—such as duplicate registrations, limited dropdown results, and password‑reset errors—traces them to ThreadLocal misuse, explains the library’s internal pagination flow, and offers practical fixes to avoid these pitfalls.

MyBatisThreadLocaljava
0 likes · 14 min read
Why PageHelper Can Break Your MyBatis Queries: Hidden ThreadLocal Pitfalls
Selected Java Interview Questions
Selected Java Interview Questions
Aug 13, 2022 · Backend Development

Understanding PageHelper Pagination Issues and ThreadLocal Management in MyBatis

This article explains how PageHelper integrates with MyBatis, analyzes common pagination bugs such as unexpected LIMIT clauses, duplicate registrations, and password‑reset errors, and demonstrates the internal ThreadLocal handling, startPage usage, and proper cleanup to avoid thread‑local pollution.

MyBatisThreadLocalpagehelper
0 likes · 12 min read
Understanding PageHelper Pagination Issues and ThreadLocal Management in MyBatis
Programmer DD
Programmer DD
Nov 29, 2021 · Backend Development

Boost MyBatis Efficiency with the PageHelper Pagination Plugin

This article introduces MyBatis-PageHelper, a universal pagination plugin that supports a wide range of databases, explains how to configure custom dialect aliases, shows Maven and Spring integration, details numerous plugin parameters, and provides multiple code examples for various usage patterns.

BackendMyBatisORM
0 likes · 9 min read
Boost MyBatis Efficiency with the PageHelper Pagination Plugin
Code Ape Tech Column
Code Ape Tech Column
May 6, 2021 · Backend Development

Why PageHelper Pagination Breaks with List Operations and How to Fix It

This article explains why PageHelper pagination yields incorrect totals when list operations are performed before or after pagination, analyzes the underlying cause that startPage only affects subsequent SQL, and provides a step‑by‑step solution that processes the list after pagination and returns a correctly populated PageInfo object.

BackendMyBatisjava
0 likes · 6 min read
Why PageHelper Pagination Breaks with List Operations and How to Fix It
Top Architect
Top Architect
Feb 17, 2021 · Backend Development

Understanding and Optimizing MyBatis PageHelper Pagination Performance

This article analyzes the performance bottlenecks of PageHelper's pagination in MyBatis, demonstrates how large offsets degrade MySQL query speed, and presents a more efficient sub‑query join solution along with suggestions for refactoring the interceptor to improve backend pagination efficiency.

BackendMyBatisjava
0 likes · 9 min read
Understanding and Optimizing MyBatis PageHelper Pagination Performance
Top Architect
Top Architect
Dec 16, 2020 · Backend Development

Integrating PageHelper with SpringBoot and MyBatis for Efficient Pagination

This article provides a comprehensive guide on integrating PageHelper with SpringBoot and MyBatis, covering development preparation, dependency configuration, basic and advanced usage patterns, code examples, and detailed explanations of pagination mechanisms, including PageParam design and MyBatis interceptor internals.

BackendMyBatisSpringBoot
0 likes · 19 min read
Integrating PageHelper with SpringBoot and MyBatis for Efficient Pagination
Programmer DD
Programmer DD
Aug 21, 2020 · Backend Development

Mastering SpringBoot: Multi-DataSource, Druid Pool, and PageHelper Pagination

This tutorial walks through integrating SpringBoot with MyBatis, configuring the Druid connection pool, setting up multiple data sources, and enabling pagination using PageHelper, complete with Maven dependencies, property files, Java configuration classes, and sample API requests and responses.

DruidMulti-DataSourceMyBatis
0 likes · 18 min read
Mastering SpringBoot: Multi-DataSource, Druid Pool, and PageHelper Pagination