Results 1 to 2 of 2

Thread: Read all rows before processing

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    New york
    Posts
    9

    Default Read all rows before processing

    Is there a way to read all items (other than setting the commit-interval to a high number) before processing? I know this goes against the chunk processing setup but I need to read all rows from a table and then start processing/writing. I would have thought that this should be doable by setting commit-interval=0 but I don't think that works.
    Last edited by javasol; Aug 22nd, 2012 at 12:21 PM.

  2. #2
    Join Date
    Feb 2012
    Location
    New york
    Posts
    9

    Default

    I was able to get it to work using the following:
    Code:
    				chunk-completion-policy="completionPolicy"> 
    			   </chunk>
    			</tasklet>			
    		</step> 
        </job>    
        <bean id="completionPolicy" class="org.springframework.batch.repeat.policy.DefaultResultCompletionPolicy"/>
    The reason I don't like this solution is because it takes a long time. I turned debug on and I see thousands of lines that look like this:

    Code:
    DEBUG [org.springframework.batch.repeat.support.RepeatTemplate] - <Repeat operation about to start at count=465>                                      
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initializing new StandardEnvironment>                                                     
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemProperties] PropertySource with lowest search precedence>                   
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemEnvironment] PropertySource with lowest search precedence>                  
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]>
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initializing new StandardEnvironment>                                                     
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemProperties] PropertySource with lowest search precedence>                   
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemEnvironment] PropertySource with lowest search precedence>                  
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]>
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initializing new StandardEnvironment>                                                     
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemProperties] PropertySource with lowest search precedence>                   
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemEnvironment] PropertySource with lowest search precedence>                  
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]>
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initializing new StandardEnvironment>                                                     
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemProperties] PropertySource with lowest search precedence>                   
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemEnvironment] PropertySource with lowest search precedence>                  
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]>
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initializing new StandardEnvironment>                                                     
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemProperties] PropertySource with lowest search precedence>                   
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Adding [systemEnvironment] PropertySource with lowest search precedence>                  
    DEBUG [org.springframework.core.env.StandardEnvironment] - <Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •