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 11/**
2- * Copyright 2009-2016 the original author or authors.
2+ * Copyright 2009-2019 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -41,17 +41,11 @@ private StatementUtil() {
4141 * @throws SQLException if a database access error occurs, this method is called on a closed <code>Statement</code>
4242 */
4343 public static void applyTransactionTimeout (Statement statement , Integer queryTimeout , Integer transactionTimeout ) throws SQLException {
44- if (transactionTimeout == null ){
44+ if (transactionTimeout == null ) {
4545 return ;
4646 }
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 );
5549 }
5650 }
5751
You can’t perform that action at this time.
0 commit comments