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

To support PreparedStatement.addBatch()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.1
    • SQL processing
    • None
    • Patch

    Description

      Create a new version of Sql.withBatch with support to prepared statements (PreparedStatement.addBatch()). For the vast majority of cases this should perform better than Sql.withBatch using statements (Statement.addBatch(String)).

      I've added some patches to perform the suggested change.
      The patch files were generated using "diff -u base_file modified_file". Groovy 1.7.5 was used as base.

      Additional information here: http://groovy.329449.n5.nabble.com/Groovy-SQL-and-batch-updates-tp4339851p4339851.html

      Thanks.

      Attachments

        1. BatchingPreparedStatementWrapper.java
          3 kB
          Daniel Henrique Alves Lima
        2. BatchingStatementWrapper.java.patch
          0.7 kB
          Daniel Henrique Alves Lima
        3. Sql.java.patch
          4 kB
          Daniel Henrique Alves Lima
        4. groovy_batch_update.zip
          7.20 MB
          Daniel Henrique Alves Lima
        5. output_rollback.txt
          1 kB
          Daniel Henrique Alves Lima
        6. output.txt
          0.4 kB
          Daniel Henrique Alves Lima
        7. run2.groovy
          4 kB
          Daniel Henrique Alves Lima
        8. output2.txt
          0.6 kB
          Daniel Henrique Alves Lima
        9. output2_rollback.txt
          1 kB
          Daniel Henrique Alves Lima
        10. batch_insert_20110428.tar.bz2
          2.97 MB
          Daniel Henrique Alves Lima
        11. grails_output.txt
          4 kB
          Daniel Henrique Alves Lima

        Issue Links

          Activity

            People

              paulk Paul King
              daniel_henrique Daniel Henrique Alves Lima
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: