GeoTools
  1. GeoTools
  2. GEOT-868

OracleFeatureWriter cannot update Geometry fields

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2-RC2
    • Fix Version/s: 2.2-RC4
    • Component/s: jdbc-oracle plugin
    • Labels:
      None

      Description

      OracleFeatureWriter has been upgraded to use prepared statements for insert and update. That's why method getGeometryInsertText(Geometry geom, int srid) now returns "?". And doUpdate(Feature live, Feature current) hasn't been changed, so it tries to execute prepared statements as statements. Obviously, doUpdate must be overriden in a manner similar to doInsert to use prepared statements.

      1. OracleFeatureWriter.java
        7 kB
        Michael Paul
      2. OracleFeatureWriter.patch
        3 kB
        Michael Paul

        Issue Links

          Activity

          Hide
          Michael Paul added a comment -
          Hi,
          I have created a little patch of the OracleFeatureWriter, overriding the doUpdate method similar to doInsert. I will attach this patched version to this issue as we..
          Show
          Michael Paul added a comment - Hi, I have created a little patch of the OracleFeatureWriter, overriding the doUpdate method similar to doInsert. I will attach this patched version to this issue as we..
          Hide
          Michael Paul added a comment -
          This version has been tested with geoserver 1.3.1 and GeoTools 2.2 RC3.
          Show
          Michael Paul added a comment - This version has been tested with geoserver 1.3.1 and GeoTools 2.2 RC3.
          Hide
          Chris Holmes added a comment -
          Ok, a bit of feedback. First, we follow pretty strict code formatting rules. Your editor sort of mangled a lot of the code, so that a diff against the source has a lot of differences. See: http://docs.codehaus.org/display/GEOT/5.1+Coding+Conventions for more information, and how to use Jalopy to automatically format the code in to the right convention.

          Second, it's generally a bit easier if you supply the fix as a patch file. See: http://docs.codehaus.org/display/GEOSDOC/Creating+a+Patch for more information. This allows me to more quickly see exactly what's different, and to apply it.

          I was able to handle the first two, ran Jalopy myself and got things to line up. But I couldn't commit because there also appears to be an update to the quoting that oracle does? There appear to now be an override for 'addQuotes'. Did you do this? Or is my source tree somehow off? That's great if it's a fix, but I didn't see it mentioned anywhere. Ideally it should be in two separate diffs, so I can apply them each as their own atomic commit, since they seem to be unrelated.

          But thanks for the patch, I'd definitely like to get this in soon.

          Chris
          Show
          Chris Holmes added a comment - Ok, a bit of feedback. First, we follow pretty strict code formatting rules. Your editor sort of mangled a lot of the code, so that a diff against the source has a lot of differences. See: http://docs.codehaus.org/display/GEOT/5.1+Coding+Conventions for more information, and how to use Jalopy to automatically format the code in to the right convention. Second, it's generally a bit easier if you supply the fix as a patch file. See: http://docs.codehaus.org/display/GEOSDOC/Creating+a+Patch for more information. This allows me to more quickly see exactly what's different, and to apply it. I was able to handle the first two, ran Jalopy myself and got things to line up. But I couldn't commit because there also appears to be an update to the quoting that oracle does? There appear to now be an override for 'addQuotes'. Did you do this? Or is my source tree somehow off? That's great if it's a fix, but I didn't see it mentioned anywhere. Ideally it should be in two separate diffs, so I can apply them each as their own atomic commit, since they seem to be unrelated. But thanks for the patch, I'd definitely like to get this in soon. Chris
          Hide
          Michael Paul added a comment -
          Hi,

          I recognize that redifining the addQuotes function actually is not necessary within current codebase. I have quit that and furthermore I generated a patch file, which is attached. This patch is atomic and only contains the method to be added (doUpdate) in order to fix the bug.

          Please note that the Japology tool added many line breaks even were the original code did not contain them. May be I did not use the tool correctly, however a mention to the -b switch of the diff may be useful in page http://docs.codehaus.org/display/GEOSDOC/Creating+a+Patch.


          Michael.
          Show
          Michael Paul added a comment - Hi, I recognize that redifining the addQuotes function actually is not necessary within current codebase. I have quit that and furthermore I generated a patch file, which is attached. This patch is atomic and only contains the method to be added (doUpdate) in order to fix the bug. Please note that the Japology tool added many line breaks even were the original code did not contain them. May be I did not use the tool correctly, however a mention to the -b switch of the diff may be useful in page http://docs.codehaus.org/display/GEOSDOC/Creating+a+Patch . Michael.
          Hide
          Chris Holmes added a comment -
          fixed on 2.2.x. Apologies I couldn't get it on to trunk, there was something screwy with the merge. r20266
          Show
          Chris Holmes added a comment - fixed on 2.2.x. Apologies I couldn't get it on to trunk, there was something screwy with the merge. r20266

            People

            • Assignee:
              Chris Holmes
              Reporter:
              Oleg Yefimov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: