groovy
  1. groovy
  2. GROOVY-3504

DataSet classes could support batch operations

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.2
    • Component/s: SQL processing
    • Labels:
      None
    • Number of attachments :
      1

      Description

      Perhaps as described here:
      http://markmail.org/thread/ciai2znkexfnrwot

        Issue Links

          Activity

          Hide
          Paul King added a comment -

          Attached patch which adds withBatch capability

          Show
          Paul King added a comment - Attached patch which adds withBatch capability
          Paul King made changes -
          Field Original Value New Value
          Attachment SqlBatch.patch [ 43408 ]
          Hide
          Paul King added a comment - - edited

          attached slightly modified spike file from Witold Szczerba - not ready for consumption in its current form

          Show
          Paul King added a comment - - edited attached slightly modified spike file from Witold Szczerba - not ready for consumption in its current form
          Paul King made changes -
          Attachment BatchInsert.java [ 43409 ]
          Hide
          Paul King added a comment -

          The withBatch method from SqlBatch.patch has been added to trunk and the 1_6_X branch.

          Show
          Paul King added a comment - The withBatch method from SqlBatch.patch has been added to trunk and the 1_6_X branch.
          Hide
          Albatross added a comment -

          The withBatch method in 1.7 beta does not support generation of a prepared statement from a GString. This is essential to prevent the need for:
          1. escaping of string values
          2. database locale-dependent string representation of dates, timestamps and numbers

          Show
          Albatross added a comment - The withBatch method in 1.7 beta does not support generation of a prepared statement from a GString. This is essential to prevent the need for: 1. escaping of string values 2. database locale-dependent string representation of dates, timestamps and numbers
          Hide
          Ken Liu added a comment -

          I believe this feature is included in 1.7.

          http://groovy.codehaus.org/(draft)+Groovy+1.7+release

          Show
          Ken Liu added a comment - I believe this feature is included in 1.7. http://groovy.codehaus.org/(draft)+Groovy+1.7+release
          Hide
          Paul King added a comment - - edited

          @Kenneth: Re: I believe this feature is included in 1.7.
          Part of the functionality from the above patches was included in 1.7 but not all.
          We will add some more batch capability once we get time to add in the remaining patches and test them.

          More specifically, the current withBatch aggregates a whole bunch of individual queries/commands to the database into a batch which gives greater efficiency. The functionality still to implement would partition a very large insert/update into smaller batch sizes. E.g. inserting 10,000 records may be done as 20 batches of 500.

          Show
          Paul King added a comment - - edited @Kenneth: Re: I believe this feature is included in 1.7. Part of the functionality from the above patches was included in 1.7 but not all. We will add some more batch capability once we get time to add in the remaining patches and test them. More specifically, the current withBatch aggregates a whole bunch of individual queries/commands to the database into a batch which gives greater efficiency. The functionality still to implement would partition a very large insert/update into smaller batch sizes. E.g. inserting 10,000 records may be done as 20 batches of 500.
          Hide
          Paul King added a comment -

          Potential patch to allow a batch size to be set on withBatch. Batches partitioned into chunks that size.

          Still not a final solution for DataSets - could be used but doesn't support prepared statements, so not ideal.

          Show
          Paul King added a comment - Potential patch to allow a batch size to be set on withBatch. Batches partitioned into chunks that size. Still not a final solution for DataSets - could be used but doesn't support prepared statements, so not ideal.
          Paul King made changes -
          Attachment groovy3405_partitioning.patch [ 48129 ]
          Paul King made changes -
          Link This issue is related to GROOVY-4146 [ GROOVY-4146 ]
          Hide
          Paul King added a comment - - edited

          I split out all of the stuff related to using Statement.executeBatch() into GROOVY-4146. This issue is now specifically just about batching of PreparedStatements which isn't supported by the Java libraries in the same way and would need to be done differently. I also moved some of the attachments into GROOVY-4146.

          Show
          Paul King added a comment - - edited I split out all of the stuff related to using Statement.executeBatch() into GROOVY-4146 . This issue is now specifically just about batching of PreparedStatements which isn't supported by the Java libraries in the same way and would need to be done differently. I also moved some of the attachments into GROOVY-4146 .
          Paul King made changes -
          Attachment groovy3405_partitioning.patch [ 48129 ]
          Paul King made changes -
          Attachment SqlBatch.patch [ 43408 ]
          Hide
          Paul King added a comment -

          See also GROOVY-4798 which covers the PreparedStatement case. So this issue now just represents the DataSet case.

          Show
          Paul King added a comment - See also GROOVY-4798 which covers the PreparedStatement case. So this issue now just represents the DataSet case.
          Paul King made changes -
          Summary Groovy's Sql and DataSet classes could support batch operations DataSet classes could support batch operations
          Paul King made changes -
          Link This issue is related to GROOVY-4798 [ GROOVY-4798 ]
          Paul King made changes -
          Resolution Fixed [ 1 ]
          Fix Version/s 2.3.2 [ 20402 ]
          Assignee Paul King [ paulk ]
          Status Open [ 1 ] Resolved [ 5 ]
          Hide
          Paul King added a comment -

          Added, see the JavaDoc for details.

          Show
          Paul King added a comment - Added, see the JavaDoc for details.
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Paul King
              Reporter:
              Paul King
            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: