#1 mORMot 2 » Atomic Transaction Handling for Multiple Related Entities in SOA » 2025-06-20 14:05:22

FatimaEzzahraa14
Replies: 1

I have a function in SOA that contains 3 parts, each part performs an Add/Update on an entity (we have 3 entities).
          In part 2, there is an entity that has a foreign key to entity 1.
          In this function, we need to perform Add/Update on all 3 entities, but if a problem occurs with any of these entities, all the modifications made in this function must be rolled back.


What is the appropriate solution for this problem?

#2 Re: mORMot 2 » Transaction with Multi-Table » 2025-06-20 09:14:07

TSynUniqueIdentifierGenerator — in which unit is it located?

#3 Re: mORMot 2 » Transaction with Multi-Table » 2025-06-19 16:23:47

Is it possible to give me an example that explains how to use TRestBatch to insert 3 objects, where I need to get the ID of the first object and use it in the second object?

#4 mORMot 2 » Transaction with Multi-Table » 2025-06-19 16:02:10

FatimaEzzahraa14
Replies: 7

As part of a 3-tier architecture (SOA), I need to implement a business function that operates on three different ORM classes, each corresponding to a different table in the database.

My goal is to ensure data consistency by using a transaction: if an error occurs while saving any of the entities, I want all changes to be rolled back.

However, in mORMot 2, the TransactionBegin(Table, SessionID) method appears to support only one class at a time.

Therefore, I am wondering:

         How can I manage a transaction that spans multiple ORM classes (tables) in mORMot?

         Does using transactions in mORMot block other users from accessing or modifying the database during the transaction?

#5 Re: mORMot 2 » Connection To PostGress » 2025-04-14 09:41:12

yes , i use it , how to fix ID instead of RowID

#6 mORMot 2 » Connection To PostGress » 2025-04-12 14:23:18

FatimaEzzahraa14
Replies: 2

When I connect to an external database like PostgreSQL, when using the MultiFieldsValues function, it returns RowId instead of ID.
why

#7 Re: mORMot 2 » IDocList/IdocDict » 2025-03-08 09:53:13

want to extract the elements that do not have a key.
is that possible?

#8 mORMot 2 » IDocList/IdocDict » 2025-03-07 15:46:06

FatimaEzzahraa14
Replies: 2

I am using the Objects property of IdocList.

For example:
var dL: IdocList;
for var d: IdocDicts in dl.Objects('Name=', '')
I found that it skips the d objects that do not have a 'Name'."

It seems like you're trying to iterate through an IdocList and filter or process objects based on their 'Name' property, but the issue is that objects without a 'Name' are being skipped.

#9 mORMot 2 » Search in DocVariantData » 2025-02-27 16:23:48

FatimaEzzahraa14
Replies: 1

exampel :

var dcTest : TDcoVariantData

dcTest := Doc.InitArray([
                  Doc.InitObject(['test', 14]),
                 Doc.InitObject(['test', 41])
             ]);

who to check if the value of 'test' equals 41 in DocVariantData.

Board footer

Powered by FluxBB