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 ma...@apache.org on 2009/07/28 03:09:30 UTC
svn commit: r798347 -
/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Author: mamta
Date: Tue Jul 28 01:09:30 2009
New Revision: 798347
URL: http://svn.apache.org/viewvc?rev=798347&view=rev
Log:
DERBY-4304
During one of the server shutdown steps, DERBY-4306 was throwing a npe(we have fixed DERBY-4306 now) and the shutdown exception handling code was calling following method on that npe
consolePropertyMessage("DRDA_UnexpectedException.S", exception.getMessage());
consoleExceptionPrintTrace(exception);
but the call exception.getMessage() on npe was returning null and consolePropertyMessage is not written to handle null 2nd param for this call of consolePropertyMessage. But the work done by this particular type of consolePropertyMessage method is also done by the next call in the shutdown exception handling which is consoleExceptionPrintTrace. Because of this, I have replaced the consolePropertyMessage("DRDA_UnexpectedException.S", exception.getMessage()); call with consolePropertyMessage("DRDA_UnexpectedException.S", true); This change makes sure we do not run into npe when exception.getMessage() is null. I am not sure if we should enter a new jira entry to make consolePropertyMessage("DRDA_UnexpectedException.S", exception.getMessage()); handle a null 2nd param.
junit tests with this change ran into intermittent upgrade test failures.
One last step remaining is may be write a new method which is a subset of consolePropertyMessage because consolePropertyMessage handles the exception printing and then goes ahead and throws the exception again. For our purposes in this jira entry, we do not want the exception to be thrown back. instead, we want to move on to the next step in server shutdown.
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=798347&r1=798346&r2=798347&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 28 01:09:30 2009
@@ -819,8 +819,7 @@
}
});
} catch (Exception exception) {
- consolePropertyMessage("DRDA_UnexpectedException.S",
- exception.getMessage());
+ consolePropertyMessage("DRDA_UnexpectedException.S", true);
consoleExceptionPrintTrace(exception);
}
@@ -832,8 +831,7 @@
try {
session.close();
} catch (Exception exception) {
- consolePropertyMessage("DRDA_UnexpectedException.S",
- exception.getMessage());
+ consolePropertyMessage("DRDA_UnexpectedException.S", true);
consoleExceptionPrintTrace(exception);
}
}
@@ -856,8 +854,7 @@
}
});
} catch (Exception exception) {
- consolePropertyMessage("DRDA_UnexpectedException.S",
- exception.getMessage());
+ consolePropertyMessage("DRDA_UnexpectedException.S", true);
consoleExceptionPrintTrace(exception);
}
}
@@ -870,8 +867,7 @@
}catch(IOException e){
consolePropertyMessage("DRDA_ListenerClose.S", true);
} catch (Exception exception) {
- consolePropertyMessage("DRDA_UnexpectedException.S",
- exception.getMessage());
+ consolePropertyMessage("DRDA_UnexpectedException.S", true);
consoleExceptionPrintTrace(exception);
}
@@ -882,8 +878,7 @@
runQueue.notifyAll();
}
} catch (Exception exception) {
- consolePropertyMessage("DRDA_UnexpectedException.S",
- exception.getMessage());
+ consolePropertyMessage("DRDA_UnexpectedException.S", true);
consoleExceptionPrintTrace(exception);
}
@@ -892,8 +887,7 @@
mgmtService.unregisterMBean(versionMBean);
mgmtService.unregisterMBean(networkServerMBean);
} catch (Exception exception) {
- consolePropertyMessage("DRDA_UnexpectedException.S",
- exception.getMessage());
+ consolePropertyMessage("DRDA_UnexpectedException.S", true);
consoleExceptionPrintTrace(exception);
}
@@ -925,8 +919,7 @@
sqle.getMessage());
}
} catch (Exception exception) {
- consolePropertyMessage("DRDA_UnexpectedException.S",
- exception.getMessage());
+ consolePropertyMessage("DRDA_UnexpectedException.S", true);
consoleExceptionPrintTrace(exception);
}
}