Bug #44587 Include "last packet successfully received" in all CommunicationsExceptions
Submitted: 30 Apr 2009 21:28 Modified: 23 Jun 2009 10:39
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.7 OS:Any
Assigned to: CPU Architecture:Any

[30 Apr 2009 21:28] Todd Farmer
Description:
The SQLError.createLinkFailureMessageBasedOnHeuristics() method creates a message text for communication link failures.  When certain conditions are met, this message includes both "last packet sent" and "last packet received" information, but when those conditions are not met, only "last packet sent" information is provided.

It would be useful to have information about when the last packet was successfully sent in all cases.

How to repeat:
Check SQLError.createLinkFailureMessageBasedOnHeuristics() method.

Suggested fix:
			if (conn != null && conn.getMaintainTimeStats()
					&& !conn.getParanoid()) {
				exceptionMessageBuf
						.append("\n\nLast packet sent to the server was ");
				exceptionMessageBuf.append(System.currentTimeMillis()
						- lastPacketSentTimeMs);
				exceptionMessageBuf.append(" ms ago.");
			}

should be modified to include "last packet received" timing information, and likely to externalize the message text snip to localized resources.
[10 Jun 2009 23:44] Todd Farmer
Fixed in r819.
[23 Jun 2009 10:39] Tony Bedford
An entry was added to the 5.1.8 changelog:

The SQLError.createLinkFailureMessageBasedOnHeuristics() method created a message text for communication link failures. When certain conditions were met, this message included both “last packet sent” and “last packet received” information, but when those conditions were not met, only “last packet sent” information was provided.

Information about when the last packet was successfully received should be provided in all cases.