The AT participant engine which handles a prepare request from the coordinator is changing state fro PREPARING to PREPARED before writing the AT participant log record to disk. The writing thread will not post PREPARED to the coordinator until it has completed the write. However, if the write takes a long time then a resend of PREPARE will be returned result PREPARED before the write has actually completed. The state transition to PREPARED should only occur once the log record write is completed.
The same problem affects the BA participants when making the transition from state CIMPLETING to COMPLETED.