Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.M1, 2.2.M2
    • Fix Version/s: None
    • Component/s: jdbc-oracle plugin
    • Labels:
      None
    • Environment:
      jdk1.5.0_05, WinXP

      Description

      The method below inside OracleDataStore.java makes query like: "select wktext from cs_srs ...."

      as cs_srs table is an object of MDSYS scheme, an exception occurs - "No CRS for srid ...." as you can see in the code.
      /////////////////original method:

      protected CoordinateReferenceSystem determineCRS(int srid ) throws IOException {
      Connection conn = getConnection(Transaction.AUTO_COMMIT);;
      String wkt=null;
      try

      { Statement st = conn.createStatement(); st.execute("select wktext from cs_srs where srid = "+srid ); ////// the line needs to be changed ResultSet set = st.getResultSet(); if( !set.next() ) return null; wkt = set.getString(1); return CRS.parseWKT( wkt ); }

      catch( FactoryException parse)

      { throw (IOException) new IOException( "Unabled to parse WKTEXT into a CRS:"+wkt ).initCause( parse ); }


      catch( SQLException sql )

      { throw (IOException) new IOException( "No CRS for srid "+srid ).initCause( sql ); }
      }


      I've replaced the query with "select wktext from mdsys.cs_srs ...." , recompiled the OracleDataStore.java file put it into oracle-spatial.jar and now it works fine for me.


      /////////////////modified method:
      protected CoordinateReferenceSystem determineCRS(int srid ) throws IOException {
      Connection conn = getConnection(Transaction.AUTO_COMMIT);;
      String wkt=null;
      try { Statement st = conn.createStatement(); st.execute("select wktext from mdsys.cs_srs where srid = "+srid ); ///// changed line ResultSet set = st.getResultSet(); if( !set.next() ) return null; wkt = set.getString(1); return CRS.parseWKT( wkt ); }
      catch( FactoryException parse){ throw (IOException) new IOException( "Unabled to parse WKTEXT into a CRS:"+wkt ).initCause( parse ); }
      catch( SQLException sql ){ throw (IOException) new IOException( "No CRS for srid "+srid ).initCause( sql ); }

      }

      i don't exactly know if im right about it being a bug...cause in uDig project i connected to Oracle without any problems like this, may be they changed that or maybe im making a mistake.

        Activity

        Hide
        Justin Smith added a comment -
        This might also be fixed by updating your Oracle configuration to have a synonym for "cs_srs" as "mdsys.cs_srs".
        Show
        Justin Smith added a comment - This might also be fixed by updating your Oracle configuration to have a synonym for "cs_srs" as "mdsys.cs_srs".
        Hide
        Andrea Aime added a comment -
        Oracle-NG does not suffer from this issue
        Show
        Andrea Aime added a comment - Oracle-NG does not suffer from this issue
        Hide
        Andrea Aime added a comment -
        Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update
        Show
        Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

          People

          • Assignee:
            Andrea Aime
            Reporter:
            Vitaliy
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: