File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
src/main/java/org/apache/ibatis/executor/statement Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright 2009-2016 the original author or authors.
2
+ * Copyright 2009-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -41,17 +41,11 @@ private StatementUtil() {
41
41
* @throws SQLException if a database access error occurs, this method is called on a closed <code>Statement</code>
42
42
*/
43
43
public static void applyTransactionTimeout (Statement statement , Integer queryTimeout , Integer transactionTimeout ) throws SQLException {
44
- if (transactionTimeout == null ){
44
+ if (transactionTimeout == null ) {
45
45
return ;
46
46
}
47
- Integer timeToLiveOfQuery = null ;
48
- if (queryTimeout == null || queryTimeout == 0 ) {
49
- timeToLiveOfQuery = transactionTimeout ;
50
- } else if (transactionTimeout < queryTimeout ) {
51
- timeToLiveOfQuery = transactionTimeout ;
52
- }
53
- if (timeToLiveOfQuery != null ) {
54
- statement .setQueryTimeout (timeToLiveOfQuery );
47
+ if (queryTimeout == null || queryTimeout == 0 || transactionTimeout < queryTimeout ) {
48
+ statement .setQueryTimeout (transactionTimeout );
55
49
}
56
50
}
57
51
You can’t perform that action at this time.
0 commit comments