Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6082

GroovyResultSet not updateable for Prepared Statements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1
    • 2.1.3, 2.2.0-beta-1
    • SQL processing
    • None
    • JDK 6u37 x86 on Win7/SP1 x64 with H2 1.3.170

    Description

      sql.resultSetConcurrency = java.sql.ResultSet.CONCUR_UPDATABLE

      followed by

      sql.eachRow('select * from WINE where ID=?', [data.ID])

      { ... }

      results in exception from underlying H2 database when trying to change the result set within the closure.

      The result set is readonly. You may need to use conn.createStatement(.., ResultSet.CONCUR_UPDATABLE). [90140-170]

      Whereas this works:

      sql.eachRow('select * from WINE where ID=' + data.ID) { ... }

      Some tentative debugging in groovy.sql.Sql failed to reach a break point set at the place where Statements are created utilizing the Sql.resultSetConcurrency property. Suspicion is, that there is a separate bit of code for PreparedStatements where Sql.resultSetConcurrency is currently disregarded.

      Attachments

        Activity

          People

            paulk Paul King
            eddelplus Jochen Eddelbuettel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: