Arsip: Konsep ChaceUpdate di ZQuery ZEOS

 
user image
more 17 years ago

onsir

Mau tanya bagaimana pengaplikasian ZQuery dengan properti Chaceupdates yg di set TRUE Klw cara biasa yg saya gunakan sperti ini: TRY Begin FMenuUtama.ZKonGlobal.StartTransaction; proses INSERT/UPDATE/DELETE FMenuUtama.ZKonGlobal.Commit; End; EXCEPT on E:Exception do Begin FMenuUtama.ZKonGlobal.Rollback; End; END; Apakah dengan Chaceupdate seprti ini, tapi konsep ini blm saya coba, atau ada rekan-rekan yg lebih tahu/lebih baik dalam penerapan konsep chaceupdate. atas penjelasannya saya ucpakan terima kasih. TRY BEGIN ZQuery1.ApplyUpdates; // PROSES INSERT/UPDATE/DELETE ZQUERY1.CommitUpdates; END; EXCEPT on E:Exception do BEGIN ZQuery1.CancelUpdates; End; END;
user image
more 17 years ago

onsir

tolong dong konsepnya, pemakaian chace update dengan StartTransaction - commit/Rollback. saya perlu masukan dari rekan-rekan.
user image
more 17 years ago

zieborg

klo aku pake cacheupdate menggunakan BDE, tapi rasanya konsep ZEOS juga sama, yaitu

procedure TForm1.ApplyButtonClick(Sender: TObject);
begin
  with CustomerQuery do
  begin
  Database1.StartTransaction;
    try
      ApplyUpdates; {try to write the updates to the database};
      Database1.Commit; {on success, commit the changes};
    except
      Database1.Rollback; {on failure, undo the changes};
    raise; {raise the exception to prevent a call to CommitUpdates!}
    end;
  CommitUpdates; {on success, clear the cache}
  end;
end;
ini potongan code dari help filenya delphi, tapi aku pernah pake ya emang konsepnya spt ini, apply update dipanggil setelah data manipulation, bukan sebelumnya, sedangkan commitupdates itu untuk membersihkan local cache
user image
more 17 years ago

onsir

Terima kasih atas bantuannya nanti saya coba.
more ...
  • Pages:
  • 1
Share to

AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now: https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com