Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361312 - SQL - Java compile failure on close SQLDataSource
Summary: SQL - Java compile failure on close SQLDataSource
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-10-18 16:44 EDT by Paul Hoffman CLA
Modified: 2017-02-23 14:17 EST (History)
1 user (show)

See Also:


Attachments
test case. (1.09 KB, application/octet-stream)
2011-10-18 16:44 EDT, Paul Hoffman CLA
no flags Details
library for loading database for test program (3.53 KB, application/octet-stream)
2011-10-18 16:45 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-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