Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012

    Unanswered: How do I prevent loading data not updated since last insert

    Hello All,

    I am looking for some help here

    I am using JPA to load data into the database through a create method. I have created a scheduler that runs every hour. How would I go about making sure that JPA only loads data that has not been updated since it's last update timestamp. I am trying to prevent duplicate data or for the system to bring back errors about the data being already populated.

    I have set the primary key on a field and If I try to insert the same data twice - I get an error. I want to avoid this error by telling the system not to create the record if the record is already in the database.

    Thanks in advance

  2. #2
    Join Date
    Jan 2007
    Jena, Germany
    I don't know what JPA is, but I'd guess you have to figure out how the code that triggers the loading has to identify which data was loaded when and just access the data that hasn't been loaded yet. In other words: this is not a problem of DB2 but of your code (or of JPA).
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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