You are not logged in.
Pages: 1
I read the document, In 8.3.7, it said:By default, all ORM read operations will be run in concurrent mode, and all ORM write operations will be executed in blocking mode. This is expected to be both safe and fast, with our internal SQLite3 engine, or most of the external databases.
... To avoid such problems, you can force all ORM write operations to be executed in a dedicated thread, i.e. by setting amMainThread (which is not very
opportune on a server without UI), or even better via amBackgroundThread or a amBackgroundORMSharedThread
Does it mean must use dedicated thread for writing? I don't like this policy, it seems like mysql SERIALIZABLE transaction isolation levels, and can make writing bottleneck, while mysql or mssql support concurrent writing.
mORMot has connection pool, per-thread in connection pool has it own transaction, why threads can not read/write concurrently ? the ZeroC ICE can do like these.
Offline
Because the incoming REST requests may come in diverse threads, so you can't ensure that the same client would send subsequent ORM requests with the same thread, so your per-thread transaction is voided.
Unless you use Batch process, which is the intended way of using transactions.
Offline
If REST client calls sql or something like using transaction, it would be wrong as you point: (for server side) the incoming REST requests may come in diverse threads. As far as I know , if transaction always in REST server not client, per-thread transaction is practicable, whenever client call function on server, must be completed by one time. REST Server function is atomic. So, it disallows using sql on client, client only calls functions on server, server does sql operation in transaction. every client call leads to server's per-thread do a transaction operation.
When my program obey this policy, can I set the mORMot concurrent writing?
Offline
I find out TSQLRestClientDB has TransactionBegin, this means transaction call on client side, this is why server side not support concurrent writing. I think that client can use sql direct through server to operating database is not a good idea.
Offline
Pages: 1