You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by bp...@apache.org on 2006/06/21 17:48:58 UTC

svn commit: r416012 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java

Author: bpendleton
Date: Wed Jun 21 08:48:57 2006
New Revision: 416012

URL: http://svn.apache.org/viewvc?rev=416012&view=rev
Log:
DERBY-1338: Client tests fail with NoClassDefFound: DRDAProtocolExceptionInfo

Patch contributed by Dag Wanvik (dag.wanvik@sun.com)

Work around a classloader bug involving interrupt handling during class
loading. If the first request to load the DRDAProtocolExceptionInfo class
occurs during shutdown, the loading of the class may be aborted when the
Network Server calls Thread.interrupt() on the DRDAConnThread.  By including
a static reference to the DRDAProtocolExceptionInfo class here, we ensure
that it is loaded as soon as the DRDAConnThread class is loaded,
and therefore we know we won't be trying to load the class during shutdown.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=416012&r1=416011&r2=416012&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Wed Jun 21 08:48:57 2006
@@ -173,6 +173,19 @@
     private static final byte[] errD4_D6 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // 12x0 
     private static final byte[] warn0_warnA = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };  // 11x ' '
 
+    // Work around a classloader bug involving interrupt handling during
+    // class loading. If the first request to load the
+    // DRDAProtocolExceptionInfo class occurs during shutdown, the
+    // loading of the class may be aborted when the Network Server calls
+    // Thread.interrupt() on the DRDAConnThread. By including a static
+    // reference to the DRDAProtocolExceptionInfo class here, we ensure
+    // that it is loaded as soon as the DRDAConnThread class is loaded,
+    // and therefore we know we won't be trying to load the class during
+    // shutdown. See DERBY-1338 for more background, including pointers
+    // to the apparent classloader bug in the JVM.
+	private static final DRDAProtocolExceptionInfo dummy =
+		new DRDAProtocolExceptionInfo(0,0,0,false);
+
 	// constructor
 	/**
 	 * Create a new Thread for processing session requests