To make sure I’m understanding correctly, with my questions as we go:
- A scheduled task runs periodically. How often does this run?
- When the service is run, it will:
2.1. Call a JDBC service to select records from the DB where stat=‘P’
2.2. For each record:
2.2.1 Call pub.publish:publish (Why is this used to get the doc to TN?)
2.2.2 Call a JDBC service to update the record to set stat=‘Y’
Are there any other steps? Are there multiple IS instances running?
I assume you have a trigger that is subscribing to the published doc type and then call TN receive. Can you describe your setup in TN? What does the service invoked by the TN rule do with the document?
Are you using try/catch blocks in your services? What do the catch blocks do?
There are a couple of ways where duplicates can be introduced:
If the above service fails after the publish but before the JDBC service successfully runs. On the next run, the previously published record will be picked up again.
If the interval of the scheduled task is sufficiently short, and allow overlap is true, and the time it takes to process all the records exceeds the interval, then a second run could get started before the first is finished. This can result in dupes.
It would be helpful for us to be able to help you if you can provide the specifics of your process. General statements like “the stat field gets updated when the records are sent to TN” aren’t all that helpful–we need to know exactly how you’re doing these things.