I didn't notice it before, because the last few weeks I'm developing on printing reports and use only selects and inserts.
This is What I do
Code: Select all
procedure TDM.MyQuery1AfterCancel(DataSet: TDataSet);
var MyQuery : TMyQuery;
begin
MyQuery := (DataSet as TMyQuery);
if MyQuery.Connection.InTransaction then
MyQuery.Connection.Rollback;
end;
procedure TDM.MyQuery1AfterPost(DataSet: TDataSet);
var MyQuery : TMyQuery;
begin
MyQuery := (DataSet as TMyQuery);
if MyQuery.Connection.InTransaction then
begin
MyQuery.Connection.Commit;
end;
end;
procedure TDM.MyQuery1BeforeEdit(DataSet: TDataSet);
var MyQuery : TMyQuery;
begin
MyQuery := (DataSet as TMyQuery);
if not MyQuery.Connection.InTransaction then
MyQuery.Connection.StartTransaction;
MyQuery.Lock(lrImmediately);
MyQuery.RefreshRecord;
end;
When I edit a record, my application immediately comes with the message "record is locked by another user".
If I edit the same record in "MySQL browser", it works without problems.
Now I downgraded to MyDAC 5.20 and the problem doesn't occur.
Please correct this error, before we're going to D2009