Repository: commons-dbcp
Updated Branches:
  refs/heads/master e6543480a -> 861879edc


Fix DBCP-459

Ensure that a thread's interrupt status is visible to the caller if the
thread is interrupted during a call to PoolingDataSource.getConnection()

Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/861879ed
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/861879ed
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/861879ed

Branch: refs/heads/master
Commit: 861879edc67cdf244d1f7d1ea927f7c1a9399263
Parents: e654348
Author: Mark Thomas <[email protected]>
Authored: Thu Nov 3 09:01:35 2016 +0000
Committer: Mark Thomas <[email protected]>
Committed: Thu Nov 3 09:01:35 2016 +0000

----------------------------------------------------------------------
 src/changes/changes.xml                                | 13 +++++++++----
 .../org/apache/commons/dbcp2/PoolingDataSource.java    |  4 ++++
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/861879ed/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index da71653..538819d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -109,10 +109,15 @@ The <action> type attribute can be add,update,fix,remove.
         remains but is deprecated so not to break clients currently using the
         incorrect name.
       </action>
-     <action dev="markt" type="add" issue="DBCP-462" due-to=" Keiichi Fujino">
-       Refactoring to prepare for a future patch to enable pooling of all
-       prepared and callable statements in PoolingConnection.
-     </action>
+       <action dev="markt" type="add" issue="DBCP-462" due-to=" Keiichi 
Fujino">
+         Refactoring to prepare for a future patch to enable pooling of all
+         prepared and callable statements in PoolingConnection.
+       </action>
+       <action dev="markt" type="fix" issue="DBCP-459">
+         Ensure that a thread's interrupt status is visible to the caller if 
the
+         thread is interrupted during a call to
+         PoolingDataSource.getConnection().
+       </action>
     </release>
     <release version="2.1.1" date="6 Aug 2015" description=
 "This is a patch release, including bug fixes only.">

http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/861879ed/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java 
b/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
index 319c36c..52f69ba 100644
--- a/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
+++ b/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
@@ -143,6 +143,10 @@ public class PoolingDataSource<C extends Connection> 
implements DataSource, Auto
             throw new SQLException("Cannot get a connection, pool error " + 
e.getMessage(), e);
         } catch(final RuntimeException e) {
             throw e;
+        } catch(final InterruptedException e) {
+            // Reset the interrupt status so it is visible to callers
+            Thread.currentThread().interrupt();
+            throw new SQLException("Cannot get a connection, general error", 
e);
         } catch(final Exception e) {
             throw new SQLException("Cannot get a connection, general error", 
e);
         }

Reply via email to