Error Messages:
syntax error, error in :‘it 1 LIMIT ? ‘
Problem Cause:
The PageHelper method uses static ThreadLocal parameters, and the paging parameters and threads are bound.
This is safe as long as we ensure that the PageHelper method is called immediately after the MyBatis query method. This is because PageHelper automatically clears the ThreadLocal stored object in the finally snippet.
The page started in the thread does not guarantee that the thread will have cleared the page variable by the time the current execution exits.
One PageHelper paging process is as follows.
i. Set the page parameter
Second, execute the query method
Third, the Interceptor interface checks whether there is a set page parameter in ThreadLocal
If the page parameter exists, regenerate count sql and page sql, and execute the query. If the page parameter does not exist, return the query result directly.
V. Execute LOCAL_PAGE.remove() to clear the page parameter.
Solution:
Call PageHelper.clearPage() at the end of the method using PageHelper;
Read More:
- [Solved] Mybatis integrates PageHelper and uses sqlserver paging error
- Mybatisenumtypehandler upgrade error of mybatis plus
- [Solved] spring boot integrated PageHelper Error
- [Solved] Mapped Statements collection does not contain value for xxx
- Mybatis plus paging Plugin and Auto-fill
- [Solved] error: method does not override or implement a method from a supertype
- Java callback function implementation case
- Asynchronous processing of HTTP request by Java_ Method 1: through callable
- Using Post no Body Error: socket hang up [How to Solve]
- feign.codec.EncodeException: Type definition error: [simple type, class java.util.Collections$3]
- How to Solve SQL comments error in the mybatis query
- Resolve warning: could’t clear Tomcat cache java.lang.NoSuchFieldException: resourceEntries
- After asynchronous file import and springboot multipartfile upload, the @async asynchronous processing reports an error: nosuchfileexception
- Doris streamload task reported an error connection reset [How to Solve]
- [Solved] JPA sett in parameter error: Java.lang.illegalargumentexception
- [Solved] ApiPost Error: org.springframework.web.multipart.MultipartException
- whitelabel error page SpEL RCE vulnerability recurrence [How to Fix]
- springboot sqlserver druid reward: validateConnection false
- How to Solve Nosuchmethoderror Error
- Java uses single thread pool to realize multi thread sequential execution (non alternating, non synchronous)