JDBCFeatureReader should build features, not wrap result sets
-------------------------------------------------------------

                 Key: GEOT-1972
                 URL: http://jira.codehaus.org/browse/GEOT-1972
             Project: GeoTools
          Issue Type: Bug
    Affects Versions: 2.5-RC0
            Reporter: Andrea Aime
            Assignee: Justin Deoliveira
             Fix For: 2.5.0, 2.6-M0


Testing with some Oracle tests shows the following exception:

{code}
java.lang.RuntimeException: java.sql.SQLException: Resultset chiuso: getMetaData
        at 
org.geotools.jdbc.JDBCFeatureReader$ResultSetFeature.mapToResultSetIndex(JDBCFeatureReader.java:711)
        at 
org.geotools.jdbc.JDBCFeatureReader$ResultSetFeature.getAttribute(JDBCFeatureReader.java:695)
        at 
org.geotools.data.oracleng.OracleDataStoreOnlineTest.testGetFeatureWriter(OracleDataStoreOnlineTest.java:286)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.sql.SQLException: Resultset chiuso: getMetaData
        at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
        at 
oracle.jdbc.driver.OracleResultSetImpl.getMetaData(OracleResultSetImpl.java:124)
        at 
org.apache.commons.dbcp.DelegatingResultSet.getMetaData(DelegatingResultSet.java:284)
        at 
org.geotools.jdbc.JDBCFeatureReader$ResultSetFeature.mapToResultSetIndex(JDBCFeatureReader.java:702)
        ... 20 more
{code}

This is due to the fact the features returned by  JDBCFeatureReader are just 
wrappers around the current record
of the result set. This is wrong from various point of view, the features 
returned can't be owned by the datastore,
they have to be long lived and independent. To support writing the datastore 
can use attribute by attribute
comparisong like the old jdbc datastore.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to