SELECT A.Id AS A_Id, A.Description AS A_Description, A.DiscountPerc AS A_DiscountPerc, A.RecVersion AS A_RecVersion
FROM Discoun A
ORDER BY A.Description Asc
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PLAN SORT (A NATURAL)
9 ms End
Even for select Statement "READ_WRITE" is set, should be "READ_ONLY".
I set "FFDConnection.TxOptions.ReadOnly := True"
or
"FFDTransaction := TFDTransaction.Create(Self);"
"FFDTransaction.Options.ReadOnly := True;"
But if after a select Statement, i need to saveupdate some entity, i have to create another Manager with different sets,
"FFDConnection.TxOptions.ReadOnly := False" ?
I noticed to, that:
FFDConnection.Transaction := FFDTransaction;
FFDConnection.UpdateTransaction := FFDTransactionUpdate; //Aurelius implement this? like TFDQuery for update and insert?
Sorry, it's a very confused topic, but Server Administrator, said that the application cause a lot of load on disk and writes
even in operations that it's not supposed to like select statements
Short READ_WRITE transactions for SELECTS are NOT a big deal in Firebird. Not much different from READ ONLY.
And for this small piece of trace log you showed, it's not possible to see the source for "lot of load and writes". The problem may be elsewhere, not READ_WRITE transactions (except if the thansactions are kept active after the select statment execution -- no commit)
You can create another manager with different sets, yes, and evict objects from one manager to the other manager.
Or you can simply directly change the TxOptions in the underlying TFDConnection directly, before updating the objects.
Hi,
"Or you can simply directly change the TxOptions in the underlying TFDConnection directly, before updating the objects."
How to do that? something like:
TFDConnection(Manager.Connection).TxOptions.ReadOnly := True; //wrong
or
TFDConnection(Manager.Connection).Transaction.Options.ReadOnly := False;
How to get access to ReadOnly?
var
MyConnection: IDBConnection;
FDConnection: TFDConnection;
{...}
FDConnection := (MyConnection as IDBConnectionAdapter).AdaptedConnection as TFDConnection;