db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r796316 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Date Tue, 21 Jul 2009 14:27:25 GMT
Author: mamta
Date: Tue Jul 21 14:27:24 2009
New Revision: 796316

URL: http://svn.apache.org/viewvc?rev=796316&view=rev
Log:
DERBY-4304

When running in insane mode, the stack trace of the exception was not getting printed in the
console log file logs/serverConsoleOutput.log The reason for this is that the code was
doing following
            consolePropertyMessage("DRDA_UnexpectedException.S",			
                exception.getMessage());
            consoleExceptionPrintTrace(exception);
That is, the stack trace printing was happening after the call to consolePropertyMessage.
The call to consolePropertyMessage results into a call to consolePropertyMessageWork which
may throw an exception back depending on the type of the error it is handling. If this method
does throw an exception, then consoleExceptionPrintTrace does not get a chance to dump the
stack trace into the logs/serverConsoleOutput. (Probably in sane mode, there is some other
additional place where we do the stack trace printing and that is why we saw the stack trace
despite consolePropertyMessage throwing an exception.) To fix the problem, I have switched
the order of the 2 calls above and that makes sure that we do print the stack trace for debugging
purpose. 


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

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=796316&r1=796315&r2=796316&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Tue Jul 21 14:27:24 2009
@@ -819,9 +819,9 @@
                        }
                     });
         } catch (Exception exception) {
+            consoleExceptionPrintTrace(exception);
             consolePropertyMessage("DRDA_UnexpectedException.S",			
                 exception.getMessage());
-            consoleExceptionPrintTrace(exception);
         }
 		
  		// Close out the sessions
@@ -832,9 +832,9 @@
  				try {
  					session.close();
  				} catch (Exception exception) {
+ 					consoleExceptionPrintTrace(exception);
  					consolePropertyMessage("DRDA_UnexpectedException.S",			
  							exception.getMessage());
- 					consoleExceptionPrintTrace(exception);
  				}
  			}
  		}
@@ -856,9 +856,9 @@
  									}
  								});
  				} catch (Exception exception) {
+ 					consoleExceptionPrintTrace(exception);
  					consolePropertyMessage("DRDA_UnexpectedException.S",			
  							exception.getMessage());
- 					consoleExceptionPrintTrace(exception);
  				}
  			}
  			threadList.clear();
@@ -870,9 +870,9 @@
 	    }catch(IOException e){
 			consolePropertyMessage("DRDA_ListenerClose.S", true);
 	    } catch (Exception exception) {
+			consoleExceptionPrintTrace(exception);
 			consolePropertyMessage("DRDA_UnexpectedException.S",			
 					exception.getMessage());
-			consoleExceptionPrintTrace(exception);
 	    }
 
 		// Wake up those waiting on sessions, so
@@ -882,9 +882,9 @@
 				runQueue.notifyAll();
 			}	
 	    } catch (Exception exception) {
+			consoleExceptionPrintTrace(exception);
 			consolePropertyMessage("DRDA_UnexpectedException.S",			
 					exception.getMessage());
-			consoleExceptionPrintTrace(exception);
 	    }
         
         // And now unregister any MBeans.
@@ -892,9 +892,9 @@
 	        mgmtService.unregisterMBean(versionMBean);
 	        mgmtService.unregisterMBean(networkServerMBean);
 	    } catch (Exception exception) {
+			consoleExceptionPrintTrace(exception);
 			consolePropertyMessage("DRDA_UnexpectedException.S",			
 					exception.getMessage());
-			consoleExceptionPrintTrace(exception);
 	    }
 
 		if (shutdownDatabasesOnShutdown) {
@@ -925,9 +925,9 @@
 										   sqle.getMessage());
 				}
 			} catch (Exception exception) {
+				consoleExceptionPrintTrace(exception);
 				consolePropertyMessage("DRDA_UnexpectedException.S",			
 						exception.getMessage());
-				consoleExceptionPrintTrace(exception);
 			}
 		}
 



Mime
View raw message