Home > Back-end >  Mybatis Preparing printing: SQL select... Where id=? When is has acquired connection or did not take
Mybatis Preparing printing: SQL select... Where id=? When is has acquired connection or did not take

Time:10-06

Below is the log, found to prepare SQL card 16 minutes,

CodePudding user response:

In the code before and after and output time consuming statements, and see which one line of code is spent 16 minutes,
Words for 16 minutes,,,,,,,,

CodePudding user response:

Let's the relevant code

How many rows of the result set

CodePudding user response:

refer to the second floor tianfang response:
or the relevant code

The result set how many rows

Public List GetRoleByUserxh (String userxh) {
Logger. The debug (" [+] getRoleByUserxh userxh={} ", userxh);
SPUserRoleExample example1=new SPUserRoleExample ();
Example1. CreateCriteria (). AndUserxhEqualTo (userxh);
List List2=userRoleMapper. SelectByExample (example1);
List Rolecodes=new ArrayList (a);
For (SPUserRole uo: list2) {
Rolecodes. Add (uo. GetRolecode ());
}
Logger. The debug (" [+] getRoleByUserxh rolecodes={} ", JsonUtil. GetJsonString (rolecodes));
Return rolecodes;
}

CodePudding user response:

refer to the second floor tianfang response:
or the relevant code

The result set how many rows


Article 6 the result set

CodePudding user response:

Your circle of two in the process of the log record is not a right,

At least not Preparing
Preparing took only 1 ms, is your lap a second and behind

CodePudding user response:

Connection when entering service,
Stick the connection pool configuration,
Enter service: OrgService. GetRoleByUserxh () to the query issued business code in front of the post, which is slowly,

CodePudding user response:

reference 5 floor tianfang reply:
you circle two in the process of the log record is not a right,

At least not Preparing
Preparing 1 ms, is second behind and you circle a


Is a, the same thread number,

CodePudding user response:

refer to 6th floor stacksoverflow response:
connection when entering service,
Stick the connection pool configuration,
Enter service: OrgService. GetRoleByUserxh () to the query issued business code in front of the post, which is slower,

The connection pool configuration







CodePudding user response:

refer to 6th floor stacksoverflow response:
connection when entering service,
Stick the connection pool configuration,
Enter service: OrgService. GetRoleByUserxh () to the query issued business code in front of the post, which is slower,

Before this is performed in the OrgService method, he didn't slow, red circle of the first time is the method of the first row,
Public List nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related