2 Replies Latest reply on Oct 29, 2019 8:54 AM by richardmoore

    jdbcItemWriter -803 retry logic

    richardmoore

      I have a process that uses the jdbcItemWriter to insert data where part of the unique key is a timestamp. Well, the process runs so fast when the rest of the fields that make up the key come in sequence together in the input it occasionally get a -803 duplicate. Is there way to have retrieve logic in the jdbcItemWriter for such things as an 803 or 911? I was hoping to not have to use a processor to create the timestamp in it and pass it as a variable.

        • 1. Re: jdbcItemWriter -803 retry logic
          cfang

          If the exception (I suspect SQLException) is specific enough, you can declare that exception type as retryable-exception-classes in job xml, and this type of failure will be retried automatically.  But if it's a SQLException, which is pretty generic and can indicate many different causes other than duplicate keys.  Also be careful with retry in item writer since the writer accumulates a list of items to write all at once, and if any one of them failed, all items in this chunk will be retried.

           

          I think a composite key that can cause duplicatation is not a good choice.  Even if you can alter your application to circumvent this error, there is still the possibility of conflicting keys.

          • 2. Re: jdbcItemWriter -803 retry logic
            richardmoore

            I agree, I just having to figure out a course of action since this was architected by someone else. This just started happening. This was great information.