Page 1 of 1

TMyTable delete error if in state DSEdit

Posted: Thu 04 Mar 2021 09:19
by TobiasHo
Is that a bug or a feature:

I use a TMyTable
1. Insert a record
2. post
3. set the state to edit
4. delete the record

Behaviour: the record is not being deleted.
Is that the expected behaviour?

Re: TMyTable delete error if in state DSEdit

Posted: Thu 04 Mar 2021 15:46
by ViktorV
Unfortunately, we are unable to reproduce the problem in our environment based on the information you provide.
In order for us to be able to give you a detailed answer, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html including the scripts for creating database objects. Also specify the version of the MySQL server that you are using.

Re: TMyTable delete error if in state DSEdit

Posted: Thu 04 Mar 2021 16:10
by TobiasHo
Sorry I donĀ“t have the time at the moment.
We fixed the problem by adding a post to the table before we delete (berfore delete function) the row.

Re: TMyTable delete error if in state DSEdit

Posted: Tue 09 Mar 2021 18:04
by ViktorV
We've sucessfully deleted a row with the following code:

Code: Select all

  MyTable.TableName := 'DEPT';
  MyTable.Open;
  MyTable.Insert;
  MyTable.Fields[0].AsInteger := 1;
  MyTable.Post;
  MyTable.Edit;
  MyTable.Fields[0].AsInteger := 2;
  MyTable.Delete;
We couldn't reproduce the issue without a sample project, unfortunately. We would greatly appreciate it if you would send us a sample project.

Re: TMyTable delete error if in state DSEdit

Posted: Thu 18 Mar 2021 09:37
by TobiasHo
Thanks for investigating .... then there might be a side issue in my code!

Re: TMyTable delete error if in state DSEdit

Posted: Thu 18 Mar 2021 09:56
by TobiasHo

Code: Select all

 Kopf.Insert;
 KopfSumme.AsFloat:=10000;
 Kopf.Post;
 Kopf.Edit;
 KopfSumme.AsFloat:=20000;
 Kopf.Delete;
No, there is a problem ...
That is exactly what I am doing.
The row with the 10000 value stays in the table after the delete command. If I add a post before the delete - everything is fine !!!

Re: TMyTable delete error if in state DSEdit

Posted: Thu 18 Mar 2021 09:58
by TobiasHo
My MySQL Setup:

Server: Localhost via UNIX socket
Server-Typ: MySQL
Server-Version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)

Re: TMyTable delete error if in state DSEdit

Posted: Thu 18 Mar 2021 10:08
by TobiasHo
I think this will help:
this works:
[img]htts://www.honscha.de/withpost.jpg[/img]
that fails:
[img]htts://www.honscha.de/withoutpost.jpg[/img]

Re: TMyTable delete error if in state DSEdit

Posted: Fri 19 Mar 2021 14:40
by ViktorV
Unfortunately, we are unable to reproduce the issue in our environment based on the information you provide. Perhaps the reason is in the settings of the component or server.
In order for us to be able to give you a detailed answer, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html

Re: TMyTable delete error if in state DSEdit

Posted: Fri 19 Mar 2021 14:43
by TobiasHo
Did you check the DBMonitor output?

Re: TMyTable delete error if in state DSEdit

Posted: Fri 19 Mar 2021 14:46
by ViktorV
Yes, they are different from your screenshots. Therefore, we asked to send an example to understand what properties you have set for our components.

Re: TMyTable delete error if in state DSEdit

Posted: Sat 20 Mar 2021 16:52
by TobiasHo
Try this and you can reproduce the error:

Code: Select all


 Kopf.LockMode:=lmPessimistic;
 Kopf.RefreshOptions:=[roBeforeEdit];
 Kopf.Insert;
 KopfSumme.AsFloat:=10000;
 Kopf.Post;
 Kopf.Edit;
 KopfSumme.AsFloat:=20000;
// Kopf.Post;
 Kopf.Delete;
 

Re: TMyTable delete error if in state DSEdit

Posted: Mon 22 Mar 2021 13:51
by ViktorV
Thank you for the information.
We've fixed the issue with transaction commiting when LockMode = lmPessimistic. The fix will be included in the next version MyDAC, which we're planning to release this week or early next week.

Re: TMyTable delete error if in state DSEdit

Posted: Tue 23 Mar 2021 13:30
by TobiasHo
That is great news ... maybe you could release the code as soon as possible so I can patch my projects.

Re: TMyTable delete error if in state DSEdit

Posted: Wed 24 Mar 2021 15:08
by ViktorV
If you need a night build for another IDE please provide the IDE version to us using contact form https://devart.com/company/contactform.html and we will send you a night build.