- If there are 1000 records in a queue to be inserted into a database using execute non query activity, what if bot fails to insert record ?
- Even if you make use of retry mechanism, try catch to handle exception, still the bot fails to insert records. How do you handle/resolve ?
Mark the transaction as Failed with System Exception using Set Transaction Status. Capture failed data in a DataTable during processing. After all transactions, write the failed data to Excel or requeue them for retry
Happy Automation
Implementation
- Enable Retry in Queue
- Implement RE framework to retry failed transaction.
Now, coming to failure
- The transaction which failed will get automatically retired if retry is enabled.
- If still it gets failed(max retry reached), next queue item will get picked up until max. consecutive exception occurred.
- Using excel reporting you can keep track of failed items.
Now, coming to continuous failure:
- If queue item are failure even after retrying, then something wrong with database.
- In that case, check whether your connection string is in active state.
- If not able to connect to DB, check reachability between ROBOT & DB server.
- Check if any changes happened in network or at DB side.
- Check if you are able to Telnet DB via CMD on robot machine. This will give you idea about connectivity & port status.
Mark as solution, if it resolved your issue.
Br,
NikZ
Use auto retry in queue ..so when marked as system exception the transaction would be retried .
At the end of the execution we can get all the data using get qurue items and check and report if anything is failed or all are successful
Cheers
βIf the bot fails to insert records into the database even after using retry and try-catch, follow these steps to handle it:
- Log the failed records β Save the details (like ID or data) of failed records into a separate log file or queue.
- Skip and continue β Let the bot move on to the next record instead of stopping completely.
- Manual review β Review the log of failed records manually or reprocess them later with a separate bot run.
- Use transaction model β Make each insert a separate transaction so failure in one doesnβt stop others.
- Add alert/notification β Send an email or alert when records fail after all retries.
This ensures that successful records are inserted, and failed ones can be handled later without stopping the whole process.β
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.