Results 1 to 4 of 4

Thread: SQL Cursor Input Source - clarifications

  1. #1
    Join Date
    Dec 2006
    Posts
    108

    Default SQL Cursor Input Source - clarifications

    Hi,

    Just to clarify some issues regarding SQL Cursor input source.

    A) Will the query get executed every time when the application starts up. What I am observing is that the tasklet that I configured which uses an input source as a SQL query, it executes the query when the application starts up. Is this correct ?

    B) Suppose I add more rows to the table, the input source always seems to pick up the initial set of data that it initially queried ? The new rows dont seem to get picked up

    I dont know if I have configured something wrong. Do let me know

    Thanks...Vijay

  2. #2
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    A: what do you mean by 'starts up'? The query is executed on the open() method of the item reader (aka input source). This usually happens lazily when the first record is read.

    B: you aren't supposed to insert extra data between restarts. If a job fails then on a restart the cursor is positioned on the last row that was successfully processed. If you inserted data before that point it wouldn't be picked up on a restart (but you would have been doing something a bit odd to start with).

  3. #3
    Join Date
    Dec 2006
    Posts
    108

    Default

    Hi Dave,

    A) What I meant was while loading the job definitions in the batch configuration files, during the application startup (we have a web application), the SQL query seems to get executed which tries to read data from the table. This is seperate from when we actually call the job explicitly.

    Thanks...Vijay

  4. #4
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    Is it possible that your JobLauncher is autostarting by default? This would explain why the job is running, and hence the query is being executed. As Dave said, the query isn't run until a call to read() is made on the ItemReader(input source).

Posting Permissions

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