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

Bug 362794

Summary: SQL - replace to result set fails
Product: z_Archived Reporter: Paul Hoffman <hoffmanp>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jvincens
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test case
none
library for loading database for test program none

Description Paul Hoffman CLA 2011-11-03 10:07:42 EDT
Created attachment 206407 [details]
Test case

SQL - replace to result set fails 

Download test case and load library initialization.

Test case results:


Start test for defect:  replace simple record to result set fails
Open result set
Read a row from result set 
Replace row values in result set row
Update row
Failure:  Exception = Invalid cursor state - no current row.: [sqlstate:24000][sqlcode:20,000]
Start test for defect:  replace annotated record to result set fails
Open result set
Read a row from result set 
Replace row values in result set row
Failure:  Exception = A null value was used.
Comment 1 Paul Hoffman CLA 2011-11-03 10:08:10 EDT
Created attachment 206408 [details]
library for loading database for test program
Comment 2 Joseph Vincens CLA 2011-11-04 15:12:27 EDT
fixed
Comment 3 Paul Hoffman CLA 2011-11-07 14:47:57 EST
This is still failing for me.    The failure is occurring on the rs.update() invocation, exception info = Invalid cursor state - no current row.: [sqlstate:24000][sqlcode:20,000]

Cursor was in position from previous rs.setNext() followed by get row.


Error log for test case is:


Start test for defect:  replace simple record to result set fails
Open result set
Read a row from result set 
Replace row values in result set row
Update row
Failure:  Exception = Invalid cursor state - no current row.: [sqlstate:24000][sqlcode:20,000]
Start test for defect:  replace annotated record to result set fails
Open result set
Read a row from result set 
Replace row values in result set row
Update row
Failure:  Exception = Invalid cursor state - no current row.: [sqlstate:24000][sqlcode:20,000]
Comment 4 Joseph Vincens CLA 2011-11-08 11:22:01 EST
There are 2 errors in the testcase.
The testcase does:
	replace row to rs ;
	log ("Update row") ;
	rs.updateRow ( ) ;
The replace actually does a rs.updateRow, so the EGL rs.updateRow will throw an exception because the cursor is not positioned.

The code closes the rs then tries to use it in a get, but didn't reopen it.
	close rs ;
	log ("Check row updated" ) ;
	set row empty ;
	get row from rs using id ;
Comment 5 Paul Hoffman CLA 2011-11-08 13:00:54 EST
verified and closed