title: Automatic Transactions in OpenJPA
body: <p>I have a class, Location. Location contains a List of BorderPoint objects, but it can be a HUGE list (20,000 is not impossible). The tables for this are LOCATION and BORDERPOINT.</p>
  
  <p>I initially populate Location via an import from an ESRI Shapefile. Here's a code snip:</p>
  
  <pre><code>        try {
              while (featureIterator.hasNext()) {
                  Location location = new Location();
  
                  SimpleFeatureImpl feature = (SimpleFeatureImpl) featureIterator.next();
  
                  // set the information in location based on stuff in the feature, lets me clean up this
                  // method a bit
                  setLocationInfo(location, feature);
  
                  List&lt;BorderPoint&gt; borderPointList = getBorderPoints(feature, location);
                  //saveBorderPoints(location, feature);
                  location.setBorderPointList(borderPointList);
  
                  try {
                      locationRepository.persist(location);
                  } catch (RepositoryException e) {
                      throw new ServiceException("processShapefile() threw RepositoryException", e);
                  }
              }
          } finally {
              featureIterator.close();
          }
  </code></pre>
  
  <p>Since there are so many BorderPoint objects in the List, but I am only saving them by calling persist on the Location object, can I automatically set some sort of batch size for persisting the BorderPoints?</p>