[libpostgresql-jdbc-java] 37/93: reset interrupted bit and throw unchecked exception if we get interrupted while trying to connect

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:18:50 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to annotated tag REL9_3_1102
in repository libpostgresql-jdbc-java.

commit 819d85fc65ee6eac984da54cea099e6525994ec9
Author: Dave Cramer <davecramer at gmail.com>
Date:   Thu Oct 17 08:29:07 2013 -0400

    reset interrupted bit and throw unchecked exception if we get interrupted while trying to connect
---
 org/postgresql/Driver.java.in | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/org/postgresql/Driver.java.in b/org/postgresql/Driver.java.in
index 72210f3..0f169c3 100644
--- a/org/postgresql/Driver.java.in
+++ b/org/postgresql/Driver.java.in
@@ -376,10 +376,14 @@ public class Driver implements java.sql.Driver
                     try {
                         wait(delay);
                     } catch (InterruptedException ie) {
-                        abandoned = true;
-                        throw new PSQLException(GT.tr("Interrupted while attempting to connect."),
-                                                PSQLState.CONNECTION_UNABLE_TO_CONNECT);
-                    }                                            
+			
+			// reset the interrupt flag                         
+			Thread.currentThread().interrupt();
+			abandoned = true;
+			
+			// throw an unchecked exception which will hopefully not be ignored by the calling code
+			throw new RuntimeException(GT.tr("Interrupted while attempting to connect."));     
+		   }                                            
                 }
             }
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list