You are not logged in.
Pages: 1
Thanks @ab. I use TSQLRestExternalDBCreate method in mORMotDB unit, which has a default parameter [regDoNotRegisterUserGroupTables].
Change [regDoNotRegisterUserGroupTables] to [] solved my problem.
I use oracle database, ServerDB.HandleAuthentication is True.
I can use Admin/synopse to authenticate.
but there is no AuthUser/AuthGroup table in oracle.Why?
other tables can be auto-created. Should i create it by hand?
@ab
Thanks. It's a good news.
@edwinsn
Thanks, I can try option 2.
I want to have an easier way. How do you solve this problem?
Hi,
Why don t use array of record (detail) as tsqlmasterrecord s property?
It's not a new project. It should works fine with old data.
And this way is not so SQL, is it?
Sorry. I still have some problems. I am using server-side transaction. I tried two ways, both have problems.
aRestServer.TransactionBegin(nil, 0);
try
aRestServer.Add(aMasterRecord, True);
aDetailRecord.MaserId := aMasterRecord.AsTSQLRecord;
aRestServer.Add(aDetailRecord, True);
aRestServer.Commit(0);
except
aRestServer.RollBack(0);
end;
In this way i can get and set the MasterId property.
But After aRestServer.Add(aMasterRecord, True), data has been written into database already. Commit and RollBack won't do nothing.
aSQLRestBatch.Add(aMasterRecord, True);
aSQLRestBatch.Add(aDetailRecord, True);
aRestServer.BatchSend(aSQLRestBatch, Res);
In this way, transactions works fine. But I don't konw how to set aDetailRecord.MasterId property.
The real problem is that I want use transactions in the Master/Detail situation, and set Master/Detail relationship correctly.
Any help?
Pass "nil" for the record class parameter to enable multi table transaction.
Note, if you are using client-side trans, it's strongly recommended to use the batch-mode instead.
thanks. I'll try this.
How to use Multi table transaction In the Master/Detail Situation?
I found TransactionBegin/BatchStart both need a TSQLRecordClass parameter, Is that means it supports one table transaction only?
I plan to use servcies, implement transaction on server side.How can I do?
Is there any demo or code snippet?
Pages: 1