We want to run a data import program ( lazarus + MyDac and Maria DB 5.5) parallel to different databases:
progA -> dbA
progB -> dbB
progC -> dbC
The Problem: All processes need to connect to a "master" db in which they must update / insert in 2 tables some data. Until now this is no problem, because they run one by one.
I try to produce a "lock problem" with a simple app:
Select * from TableX
while not EOF
INSERT / UPDATE into Table y
NEXT
end;
But I can run this app 2, 3 or 4 times an no lock error is shown (lockmode = lmOptimistic) - and I don't understand that point. Why no lock error is shown..?!?
Best regards
Wolfgang
MariaDB 5.5 and lockMode
Re: MariaDB 5.5 and lockMode
If the TMyQuery.LockMode property has the value lmNone, the record blocking won't performed.
If you assign the value lmPessimistic to the LockMode property, the record that you're editing will be blocked when you call the Edit method.
If the value is set to lmOptimistic, the record will be blocked when the Post method is called. Only the changes made during the most recent call of the Post method will be saved on the server, regardless of what user was the first to edit the data.
You can see find a demo of using the TMyQuery.LockMode property in our MyDacDemo project in the 'MySQL-specific Demos\Lock' tab, which is located in the directory: %MyDACDemos%\MyDacDemo, where %MyDACDemos% is the path to the directory where MyDAC Demo projects are installed on your computer.
If you assign the value lmPessimistic to the LockMode property, the record that you're editing will be blocked when you call the Edit method.
If the value is set to lmOptimistic, the record will be blocked when the Post method is called. Only the changes made during the most recent call of the Post method will be saved on the server, regardless of what user was the first to edit the data.
You can see find a demo of using the TMyQuery.LockMode property in our MyDacDemo project in the 'MySQL-specific Demos\Lock' tab, which is located in the directory: %MyDACDemos%\MyDacDemo, where %MyDACDemos% is the path to the directory where MyDAC Demo projects are installed on your computer.
Re: MariaDB 5.5 and lockMode
ah... so if I only user Update/Insert SQL and no bidirectional DB-binding (TDBEdit) .lockMode has no effect...
Thanks!!
Thanks!!
Re: MariaDB 5.5 and lockMode
Thank you for your interest in our product.
If you have any questions about our products, don't hesitate to contact us - we will do our best to help you.
If you have any questions about our products, don't hesitate to contact us - we will do our best to help you.