Bug #51776 Connection.rollback() doesn't throw Exception if connection dies
Submitted: 5 Mar 2010 19:33 Modified: 8 Mar 2010 17:45
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.1.12 OS:Any
Assigned to: Todd Farmer CPU Architecture:Any

[5 Mar 2010 19:33] Todd Farmer
Description:
It's possible for rollback() to fail to rethrow a SQLException if the server dies during a rollback.  The code only rethrows currently when ignoreNonTxTables is true and the exception does not have error code 1196 (SQLError.ER_WARNING_NOT_COMPLETE_ROLLBACK).

How to repeat:
Drop connection before issuing rollback().

Suggested fix:
Propogate Exception.
[5 Mar 2010 21:27] Todd Farmer
Patch for 51783 and 51776

Attachment: diff.txt (text/plain), 19.30 KiB.

[5 Mar 2010 21:29] Todd Farmer
Pushed in r911.
[8 Mar 2010 17:45] Tony Bedford
An error has been added to the 5.1.13 changelog:

The rollback() method could fail to rethrow a SQLException if the server became unavailable during a rollback. The errant code only rethrew when ignoreNonTxTables was true and the exception did not have the error code 1196, SQLError.ER_WARNING_NOT_COMPLETE_ROLLBACK.