Announcement Announcement Module
Collapse
No announcement yet.
How to configure ItemReader to read data one at a time Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to configure ItemReader to read data one at a time

    Hi all
    I've the following requirements, I just wanted to know if this is possible using the HibernateCursorItemReader or any custom ItemReader implementation

    1. A quartz job which runs on a schedule, say every 30 mins.
    2. This Job has to read from one row from a table based on a criteria [even if the criteria matches many rows, the query retrieves the least recent row] and process it and write it to a csv file. [ItemReader, ItemProcessor, ItemWriter]
    3. I've configured all of these, but my issue is the job should terminate after it is done with the writing. The next job execution ha
    But the ItemReader continues to read all the rows from the table and all rows are getting processed in a single execution.

    Is there anyway to implement my kind of requirement?

  • #2
    Both the HibernateCursorItemReader and JdbcCursorItemReader work off of HQL and SQL queries respectively. I see now reason why you can't create a query for the cursor to use that restricts the data in the way you need. It sounds like you're just opening up the cursor on the whole table, which isn't what you want, just be more restrictive in your query.

    Comment

    Working...
    X