Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 270969

Summary: [DB] Checking of return result of batched statements is not standards conform
Product: [Modeling] EMF Reporter: Stefan Winkler <stefan>
Component: cdo.dbAssignee: Stefan Winkler <stefan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: stepper
Version: 2.0   
Target Milestone: M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 270428    
Attachments:
Description Flags
Patch none

Description Stefan Winkler CLA 2009-04-02 10:31:03 EDT
See bug 270428: 

The return values of batched statements should be checked more carefully:

The JDBC spec says:

The elements in the array returned by the method executeBatch  may be one of the following:

   1. A number greater than or equal to zero -- indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
   2. A value of SUCCESS_NO_INFO -- indicates that the command was processed successfully but that the number of rows affected is unknown
   3. A value of EXECUTE_FAILED -- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails
Comment 1 Stefan Winkler CLA 2009-04-02 11:11:06 EDT
Created attachment 130705 [details]
Patch

oh well, this was easier than I thought.

The statements which are batched here are only of two kinds - INSERT_ATTRIBUTE and UPDATE_REFERENCE_VERSION. Both should not be checked for the update count. So I changed the condition to result != Statement.EXECUTION_FAILED. 

This issue should be revisited after Bug 260047 is implemented.
Comment 2 Stefan Winkler CLA 2009-04-02 11:11:29 EDT
Committed to HEAD.
Comment 3 Eike Stepper CLA 2009-04-02 17:35:09 EDT
Fix available in EMF CDO 2.0.0M6b
Comment 4 Eike Stepper CLA 2009-06-27 11:50:03 EDT
Generally available.