function TCustomerPayment.SaveTransaction: Boolean; var done : Boolean; retryCount : Integer; begin retryCount := 0; done := False; Result := False; while not done do begin try UniConn.StartTransaction; tblPayment.Append; ... ... tblPayment.Post; // On rare occassions this transaction appears in the database twice ???? UniConn.Commit; done := True; Result := True; except begin UniConn.Rollback; Inc(retryCount); if retryCount = 5 then begin done := True; end; end; end; end; end;
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.