Still having transaction group error issues

At customer’s site after installing V7.5.7 to resolve PLC communication errors, and I still have this occassional error pop up:

This is a Mission Critical application using MySQL 5.1 with replication enabled

I may have answered my own question. I think I have a timing issue between the the time the OPC items update and the trigger fires. I have a 2 second delay in the PLC program to move data into all the OPC items , then fire the trigger bit. I think 2 seconds may be borderline, as in a recent install at another location I noticed a 2 -3 second delay in update time for all tags in the Basic OPC items.

In this case because my OPC group did not get an updated Primary Key (Batchnumber) in time before the trigger fired, the duplicate primary key error was generated.

as a general rule of thumb I found that If i have a delay to set the trigger of at least 3 times the transaction group update time I will always see the proper updated data to be recorded.