Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362794 - SQL - replace to result set fails
Summary: SQL - replace to result set fails
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 10:07 EDT by Paul Hoffman CLA
Modified: 2017-02-23 14:19 EST (History)
1 user (show)

See Also:


Attachments
Test case (2.61 KB, application/octet-stream)
2011-11-03 10:07 EDT, Paul Hoffman CLA
no flags Details
library for loading database for test program (11.02 KB, application/octet-stream)
2011-11-03 10:08 EDT, Paul Hoffman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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