db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r106436 - /incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java
Date Wed, 24 Nov 2004 17:24:47 GMT
Author: kmarsden
Date: Wed Nov 24 09:24:47 2004
New Revision: 106436

URL: http://svn.apache.org/viewcvs?view=rev&rev=106436
Log:
Fix for intermittent hang with database shutdown.
Contributed by Army Brown


Modified:
   incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java

Modified: incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java?view=diff&rev=106436&p1=incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java&r1=106435&p2=incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java&r2=106436
==============================================================================
--- incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java	(original)
+++ incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java	Wed
Nov 24 09:24:47 2004
@@ -1352,9 +1352,9 @@
 		Session retval = null;
 		if (shutdown == true)
 			return retval;
-		try {
-			synchronized (runQueue)
-			{
+		synchronized (runQueue)
+		{
+			try {
 				// nobody waiting - go on with current session
 				if (runQueue.size() == 0)
 				{
@@ -1379,8 +1379,14 @@
 				runQueue.removeElementAt(0);
 				if (currentSession != null)
 					runQueueAdd(currentSession);
+			} catch (InterruptedException e) {
+			// If for whatever reason (ex. database shutdown) a waiting thread is
+			// interrupted while in this method, that thread is going to be
+			// closed down, so we need to decrement the number of threads
+			// that will be available for use.
+				freeThreads--;
 			}
-		}catch (InterruptedException e) {}
+		}
 		return retval;
 	}
 	/**

Mime
View raw message