You are not logged in.
Pages: 1
Hi, I have 2 objects of TSQLRecord (TFahter and TChildren). I Want to save both in the same time. How should I do it ? How to define Transcation and commit ?
Thank You
Last edited by bagusprasojo (2016-10-05 03:02:45)
Offline
It's recommended to use "batch mode":
http://synopse.info/files/html/Synopse% … l#NDX_1604
When creating the TSQLRestBatch instance, supply 'nil' for the 'aTable' param.
Caveat: When calling Add/Delete/Update methods of it, don't forget to pass the correct 'TSQLRecord' subclass, otherwise it won't work **siliently** ( suggested @ab to raise exception in this case, but he don't agree .
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Hi edwinsn thank you for your quick response.
I did it using "batch mode" also. But I got trouble when TFahter has property refers to TChildren. Everytime I save those objects, field Children in table TFather is always "0". I don't know how to use "batch mode" in this case.
Thanks
Offline
You can force the ID, using an incremental integer on the server side, or TSynUniqueIdentifier if you want something unique over a network.
Hi AB, how to Force ID if ID is readonly property ?
Thanks
Last edited by bagusprasojo (2016-11-10 04:59:25)
Offline
Try IdValue.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
OK, Solved ! Thank you all
Offline
Pages: 1