#1 Re: mORMot 1 » table AuthUser/AuthGroup does not auto-create » 2017-03-13 02:46:48

Thanks @ab. I use TSQLRestExternalDBCreate method in mORMotDB unit,  which has a default parameter  [regDoNotRegisterUserGroupTables].
Change [regDoNotRegisterUserGroupTables] to [] solved my problem.

#2 mORMot 1 » table AuthUser/AuthGroup does not auto-create » 2017-03-10 07:46:22

fubail@qq.com
Replies: 2

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?

#4 Re: mORMot 1 » How to use Multi table transaction » 2017-01-22 09:02:41

@edwinsn
Thanks, I can try option 2.
I want to have an easier way. How do you solve this problem?

#5 Re: mORMot 1 » How to use Multi table transaction » 2017-01-22 08:33:24

lele9 wrote:

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?

#6 Re: mORMot 1 » How to use Multi table transaction » 2017-01-22 07:46:10

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?

#7 Re: mORMot 1 » How to use Multi table transaction » 2017-01-13 08:33:40

edwinsn wrote:

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.

#8 mORMot 1 » How to use Multi table transaction » 2017-01-13 04:21:37

fubail@qq.com
Replies: 14

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?

#9 mORMot 1 » How to use external stored procedure? » 2016-10-11 02:47:54

fubail@qq.com
Replies: 1

Is there any demo or code snippet?

Board footer

Powered by FluxBB