Home Database Mysql Tutorial 诡异的分页代码失效问题

诡异的分页代码失效问题

Jun 07, 2016 pm 04:12 PM
code Pagination Preface Invalid question

前言: 之前碰到了一个界面上分页失效的问题,并为之困扰了数日,后台定位为排序失效的问题,问题就迎刃而解了... 问题描述: 在界面上的某个分页功能存在失效的问题,第一页、第二页和最后一页的分页效果正常,但是中间的分页数据不变。 QA提了一个关于此的

前言: 之前碰到了一个界面上分页失效的问题,并为之困扰了数日,后台定位为排序失效的问题,问题就迎刃而解了...

问题描述:

在界面上的某个分页功能存在失效的问题,第一页、第二页和最后一页的分页效果正常,但是中间的分页数据不变。 QA提了一个关于此的Bug.

问题分析:

1. 分析界面分页代码

界面分页的代码属于在项目使用较多的组件,关于失效分页部分的代码无特殊的定制和使用。

2. 前端和后台端交互的分析

基于HTTP的监控工具,发现分页请求的请求数据一切正常,分页的start/limit数据正确,过滤条件是正确的,排除前端问题。

3. 后台的代码分析

后台的代码是基于Hibernate实现的DAO查询分析,代码基于基类的常规查询,无特殊代码存在。而且这些基类的常规查询被项目中不同的模块所使用,其他模块功能正常。

故对这些查询的代码是否存在问题,持怀疑态度。

4. 怀疑生成的SQL是否存在问题

打印出在查询中使用的SQL语句,经过分析,SQL也不存在问题。其中使用了log4jdbc来监控sql执行。

5. 基于查询中使用的SQL在Oracle的plsql中直接运行SQL

结果发现,在50~75, 75-~100等区间,的确查询数据不变。 SQL语句:

 select *
          from (select row_.*, rownum rownum_
            from (select this_.id          as id25_0_,
                         this_.create_time as create2_25_0_,
                         this_.creator     as creator25_0_,
                         this_.modify_time as modify4_25_0_,
                         this_.updater     as updater25_0_,
                         this_.version     as version25_0_,
                         this_.bank_id     as bank7_25_0_,
                         this_.bank_name   as bank8_25_0_,
                         this_.chk_comment as chk9_25_0_,
                         this_.chk_status  as chk10_25_0_,
                         this_.cup_bank_id as cup11_25_0_,
                         this_.del_status  as del12_25_0_,
                         this_.smp_name    as smp13_25_0_,
                         this_.status      as status25_0_
                    from ns_para_bank this_
                   where this_.chk_status = '02'
                     and this_.chk_status = '02'
                     and this_.del_status = '01'
                   order by this_.modify_time desc
                   ) row_
           where rownum <= 100)
         where rownum_ > 75
Copy after login
6. 后怀疑是排序字段modifyTime问题

 

经过排查,发现大部分的modifiedTime字段的数据为空,故导致了排序失效;由于排序失效,引发了分页数据不变的问题

问题的解决

为排序条件新增了一个排序字段, 在modified_time失效的情况下,保证整体排序的有效性,即可解决分页失效问题。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What to do if the blue screen code 0x0000001 occurs What to do if the blue screen code 0x0000001 occurs Feb 23, 2024 am 08:09 AM

What to do with blue screen code 0x0000001? The blue screen error is a warning mechanism when there is a problem with the computer system or hardware. Code 0x0000001 usually indicates a hardware or driver failure. When users suddenly encounter a blue screen error while using their computer, they may feel panicked and at a loss. Fortunately, most blue screen errors can be troubleshooted and dealt with with a few simple steps. This article will introduce readers to some methods to solve the blue screen error code 0x0000001. First, when encountering a blue screen error, we can try to restart

Resolve code 0xc000007b error Resolve code 0xc000007b error Feb 18, 2024 pm 07:34 PM

Termination Code 0xc000007b While using your computer, you sometimes encounter various problems and error codes. Among them, the termination code is the most disturbing, especially the termination code 0xc000007b. This code indicates that an application cannot start properly, causing inconvenience to the user. First, let’s understand the meaning of termination code 0xc000007b. This code is a Windows operating system error code that usually occurs when a 32-bit application tries to run on a 64-bit operating system. It means it should

GE universal remote codes program on any device GE universal remote codes program on any device Mar 02, 2024 pm 01:58 PM

If you need to program any device remotely, this article will help you. We will share the top GE universal remote codes for programming any device. What is a GE remote control? GEUniversalRemote is a remote control that can be used to control multiple devices such as smart TVs, LG, Vizio, Sony, Blu-ray, DVD, DVR, Roku, AppleTV, streaming media players and more. GEUniversal remote controls come in various models with different features and functions. GEUniversalRemote can control up to four devices. Top Universal Remote Codes to Program on Any Device GE remotes come with a set of codes that allow them to work with different devices. you may

What does the blue screen code 0x000000d1 represent? What does the blue screen code 0x000000d1 represent? Feb 18, 2024 pm 01:35 PM

What does the 0x000000d1 blue screen code mean? In recent years, with the popularization of computers and the rapid development of the Internet, the stability and security issues of the operating system have become increasingly prominent. A common problem is blue screen errors, code 0x000000d1 is one of them. A blue screen error, or "Blue Screen of Death," is a condition that occurs when a computer experiences a severe system failure. When the system cannot recover from the error, the Windows operating system displays a blue screen with the error code on the screen. These error codes

How to solve the common problem of Laravel login time invalidation How to solve the common problem of Laravel login time invalidation Mar 06, 2024 pm 09:24 PM

How to solve the common problem of Laravel login time expiration When using Laravel to develop web applications, login authentication is a very important function. However, sometimes if a user does not operate for a long time after logging in, the page may automatically log out or the authentication may fail. This problem is relatively common. The following will introduce how to solve this problem by setting the session time and provide specific code examples. 1. Set the session expiration time in Laravel, by default sessi

How to use Copilot to generate code How to use Copilot to generate code Mar 23, 2024 am 10:41 AM

As a programmer, I get excited about tools that simplify the coding experience. With the help of artificial intelligence tools, we can generate demo code and make necessary modifications as per the requirement. The newly introduced Copilot tool in Visual Studio Code allows us to create AI-generated code with natural language chat interactions. By explaining functionality, we can better understand the meaning of existing code. How to use Copilot to generate code? To get started, we first need to get the latest PowerPlatformTools extension. To achieve this, you need to go to the extension page, search for &quot;PowerPlatformTool&quot; and click the Install button

Create and run Linux ".a" files Create and run Linux ".a" files Mar 20, 2024 pm 04:46 PM

Working with files in the Linux operating system requires the use of various commands and techniques that enable developers to efficiently create and execute files, code, programs, scripts, and other things. In the Linux environment, files with the extension &quot;.a&quot; have great importance as static libraries. These libraries play an important role in software development, allowing developers to efficiently manage and share common functionality across multiple programs. For effective software development in a Linux environment, it is crucial to understand how to create and run &quot;.a&quot; files. This article will introduce how to comprehensively install and configure the Linux &quot;.a&quot; file. Let's explore the definition, purpose, structure, and methods of creating and executing the Linux &quot;.a&quot; file. What is L

Tsinghua University and Zhipu AI open source GLM-4: launching a new revolution in natural language processing Tsinghua University and Zhipu AI open source GLM-4: launching a new revolution in natural language processing Jun 12, 2024 pm 08:38 PM

Since the launch of ChatGLM-6B on March 14, 2023, the GLM series models have received widespread attention and recognition. Especially after ChatGLM3-6B was open sourced, developers are full of expectations for the fourth-generation model launched by Zhipu AI. This expectation has finally been fully satisfied with the release of GLM-4-9B. The birth of GLM-4-9B In order to give small models (10B and below) more powerful capabilities, the GLM technical team launched this new fourth-generation GLM series open source model: GLM-4-9B after nearly half a year of exploration. This model greatly compresses the model size while ensuring accuracy, and has faster inference speed and higher efficiency. The GLM technical team’s exploration has not

See all articles