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

Bug 361312

Summary: SQL - Java compile failure on close SQLDataSource
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-10-18 16:44:46 EDT
Created attachment 205459 [details]
test case.

The spec indicates that close operates on any data source.

SQLDataSource external type has function isClosed().

However close ds statement gets a Java compile error because Java generation assumes the target data source is a SQLResultSet.

Java generation should generate code appropriate for the type of data source.

See attached test case.
Comment 1 Paul Hoffman CLA 2011-10-18 16:45:22 EDT
Created attachment 205460 [details]
library for loading database for test program
Comment 2 Joseph Vincens CLA 2011-10-19 07:08:53 EDT
fixed
Comment 3 Joseph Vincens CLA 2011-10-20 10:55:34 EDT
Hi Paul
I fixed the compilation error yesterday and marked this resolved.
When I ran the test it threw an exception on commit. At first I thought this should be expected. As I thought more about it, I think it makes more sense if a DataSource or RS is closed it should be in it's initial state, waiting for a statement to make a connection. 
I just committed a fix where if you close a RS or DS I perform the operation on the EGL SQLDataSource or SQLResultSet, this sets the actual java sql connection or rs to null. This prevents exceptions and puts the EGL objects in their initial state. 
If you don't agree with this reopen the defect and let me know how you think it should work.
Comment 4 Paul Hoffman CLA 2011-11-09 16:17:18 EST
verified and closed