throws exception while updating multiple geometry column feature. Bug in 
OracleFeatureWriter.doUpdate() method
--------------------------------------------------------------------------------------------------------------

                 Key: GEOT-1828
                 URL: http://jira.codehaus.org/browse/GEOT-1828
             Project: GeoTools
          Issue Type: Bug
          Components: data oraclespatial
    Affects Versions: 2.4.3
            Reporter: Profii
            Assignee: Andrea Aime
            Priority: Blocker


Throws following exception while updating a feature with more than one 
GeometryAttriburteTypes in it.

Caused by: java.sql.SQLException: Missing IN or OUT parameter at index:: 2
        at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
        at 
oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1711)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(
20:52:46,411 INFO  [STDOUT] OraclePreparedStatement.java:3311)
        at 
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3422)
        at 
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)
        at 
org.geotools.data.oracle.OracleFeatureWriter.doUpdate(OracleFeatureWriter.java:137)


The bug lies within  OracleFeatureWriter.java implementation.
-for loop implemented within doUpdate() method breaks as soon as it finds a 
GeometryAttributeType.
-Where as doInsert() method doesn't breaks, so Inserting a feature with 
multiple GeometryAttributeTypes works fine in this case.

Here is the code snippit of doUpdate() implementation.

{noformat} 
            for (int i = 0; i < current.getNumberOfAttributes(); i++) {
                AttributeType type = schema.getAttributeType(i);

                if (type instanceof GeometricAttributeType && 
!DataUtilities.attributesEqual(current.getAttribute(i), live.getAttribute(i))) {
                    Geometry geometry = (Geometry) current.getAttribute(i);

                    if (geometry == null) {
                        geometry = current.getDefaultGeometry();
                    }

                    LOGGER.fine("ORACLE SPATIAL: geometry to be written:"
                        + geometry);

                    STRUCT struct = converter.toSDO(geometry);
                    statement.setObject(position, struct);
                    LOGGER.fine(
                        "ORACLE SPATIAL: set geometry parameter at position:"
                        + position);
                    position++;
                   break;
                }
            }
{noformat} 

Can anyone provide me patch please. I need this fix urgently. :)

thx,
-Profii

-- 
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to