Announcement Announcement Module
No announcement yet.
SQL Cursor Input Source - clarifications Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Cursor Input Source - clarifications


    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


  • #2
    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
      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.



      • #4
        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).