Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issues in BulkCopy exception handling (#801)
1. Removing the catch block, because the driver should not blindly send attention packets. To cancel a query, attention packets should only be sent if the client has already sent a request, which has the last packet with EOM bit (0x01) set in status. If a complete request has not been sent to the server, the driver MUST send the next packet with both ignore bit (0x02) and EOM bit (0x01) set in the status to cancel the request (2.2.1.7 of TDS Technical Documentation). This is already properly handled in IOBuffer.execute(), which is the only method that calls doInsertBulk(). 2. Adding this.tdsMessageType == TDS.PKT_BULK, because prior to TDS.PKT_BULK, the driver has already sent INSERT BULK SQL statement to the server, which in case of an exception needs to be cancelled too.
- Loading branch information